About

Introduction

WP-JIT allows users to enter shortcodes into pages or use Gutenberg blocks with fields. The shortcodes or blocks define which post, page or template should be displayed. The user can select static delivery, e.g. for content above the fold, or dynamic delivery to display the content only when it is scrolled into view.

A user can add classes to define how the content is displayed, e.g. a fade. The user can use standard query variables (category, offset, etc.) or specify a post/page ID or template name. The post content is displayed based on the default content display file where no file is indicated or the user can choose a file (e.g. excerpt-template.php) to define the content display format.

Implementation

The static method simply renders the defined content as it would be rendered in the normal WordPress process. The dynamic content incorporates a request mechanism which fetches the content when triggered by the intersection observer. The content is then cached as a transient for the session.

Known Limitations

When markup is inserted into the page dynamically some interactivity may not be recognized by vanilla javascript, jQuery does not have the same issue. The rendered size of the content being delivered is not known which means the presentation can be a little quirky, there is no placeholder mechanism which reflects the size of the delivered content due to be delivered. CSS can be used to define the content size.