Site logo

Archived topic

Duplicate Post on Home Page

5 replies · Started by Simon on October 10, 2018

Viewing posts 1–6 of 6

Hi,

On the home page of the site included in URL for admins, you can see I have the current home page set to show the latest posts.

My client wants to show a single featured post using the category tag, "Featured". I achieved this using GeneratePress Elements and Tom's WP Show Posts plugin.

However, when doing so, the Featured Post appears both in my custom Hook and in the main loop on the Home page. I can stop this by offset 1 for the WP Show Posts list, however, it's not ideal as it then doesn't show the most recent featured post.

How can I hide the duplicated post in the main loop on the Home page? The post in question for this example is called "TTEC Unveils New Customer Experience Innovation Lab in Belfast" and is located in my custom hook at the top of the page and further down the list of articles again in the main loop on the Home page.

Kind regards,

Simon

Hi Leo,

Would that CSS not have to be changed each time the featured post changed?

It changes daily.

Sorry, not had a chance to test yet, I just wanted to ask that additional question before testing.

Kind regards,

Simon

Ahh I see. Edited the code above.

Hi Leo,

Thanks for editing the code. I tested it and it works perfectly!

Kind regards,

Simon

No problem :)

This archived topic is closed to new replies.