Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Have a “featured” story in a query loop

  • We have many posts and often the main story is cycled out because a post with a newer date is published.

    I would like to use something like the “Sticky” feature where you could elect to have a post be featured or sticky and stay as the main #1 story until a newer story is published with the sticky option. Or, perhaps a particular tag is posted.

    What’s the most practical way to accomplish this? I have tried adding parameters like sticky or a specific tag but if there is the potential for lots of posts to have this kind of tag or sticky parameter, which seems to interfere with displaying the newest sticky post’

    I’d welcome any insight, thanks! In my example it’s the large story on the left column. The above the fold are is three query loops using offsets to display ‘front page’ category posts.

  • Hi Marty,

    The most practical way is to create a category or tag for “featured” posts. Then, grab that through a Query loop, and exclude it in another Query Loop or through code if you’re showing it in an archive or blog page.

  • Thanks Fernando.

    This issue becomes when we are trying to hold a story in place with this strategy but the dates are different. For example two stories:

    April 19
    April 20

    Both set as the featured category. If both stories are in the featured category, the orderby will dictate it’s the newest post in featured category. What I’m looking to do is something where I just assigned the category to a post, no matter what the date, so that becomes the main featured story. Does that make sense?

    Thanks!

  • Hi Marty,

    It makes sense but you’ll need custom code for something like that. Unfortunately, this level of customization would be out of our scope of support.

    How many featured posts are you wanting to have?

  • I would like just one featured post displayed, while avoiding having to remove the featured tag from the last story I featured. I have managed to do this by using ‘last modified’ in the orderby settings, I was curious if there was a more intuitive way to do it. Thanks for your help!

  • I would suggest asking in WordPress forums if it’s possible to store a post meta value once and only when a post is tagged “featured”: https://wordpress.org/support/forum/wp-advanced/

    You’re welcome, Marty!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.