In a previous tutorial, I showed how the current post can be excluded from the list of recent posts when we are on a single post page using a Code Block here.

This members-only tutorial shows how the same can be done but when using Oxygen's Repeater component to output the posts list.

By default the current post may appear in the recent posts list:

We can use pre_get_posts action hook to set post__not_in for the query to the current post's ID even if the query is a custom one like in the case of a Repeater thereby preventing the current post from appearing in the latest posts.

Step 1

Edit the Oxygen Template that applies to singular posts.

Add a Repeater component and build the Div for each post. In my test site, I set up the featured image and a Div to appear next to each other with the Div having linked post title and excerpt showing 5 words.

If you would like to paste the Repeater from my test site as a starting point, follow these steps:

a) Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: Custom excerpt

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($37/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: