[Support request] Feature a post but don’t show it in query loop

Home Forums Support [Support request] Feature a post but don’t show it in query loop

Home Forums Support Feature a post but don’t show it in query loop

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2284589
    Brian

    Hi we are working on a new site layout (link in private info)

    What I want todo is have a featured post at the top of the page, then use a query loop to show the other posts posts.

    Now I know I can use the sticky feature, but I want to automate things, so I just want the latest post to be the featured one at the top.

    Is there some kind of logic i can use to say if a post is featured do not show it in the post list below featured?

    I might change the design to maybe feature two or three posts, so a similar question can I hide these posts from showing in the post list below?

    Maybe have a query loop for the featured posts, and a query loop for the rest of the posts, but I need some logic that says don’t show posts that are featured in the normal posts list.

    I hope this makes sense.

    Note I have GP and GB pro.

    Thanks

    #2284658
    Ying
    Staff
    Customer Support

    Hi there,

    You can use the block element – content template to achieve this.
    https://docs.generatepress.com/article/block-element-content-template/

    1. Create a content template for all post, for example name it “blog content template” and apply it to all post:
    https://www.screencast.com/t/7o9NwaNlCT

    2. Create a new content template for the fist posts, and apply it to the first post, select the “blog content template “as its parent element:
    https://www.screencast.com/t/YwUSoTnN

    3. Go to customize > layout > blog, tick the Make first post featured box and Display posts in columns box.

    #2287704
    Brian

    Thanks Ying, but I think i found an easier way to do it.

    I used two query loops but for the second one I added the parameter offset and set it to 1, this seemed to work ๐Ÿ™‚

    #2287747
    Ying
    Staff
    Customer Support

    Glad you found a way ๐Ÿ™‚

    #2288673
    Brian

    I think i am nearly there
    https://test.sluggerotoole.com/

    I added them as 2 elements and followed your original instructions. The one last issue is I can’t work out why the featured post is so wide, also if you scale the page to tablet view see how it goes really weird.

    Any suggestion to fix that? These are the container settings
    07.20.2022-16.39.19

    Also I had it working like this
    07.20.2022-16.36.56

    Were the featured post is on top of the posts and the sidebar, but it was repeating the featured post in the bottom posts. Not sure if there is a way to keep the featured post above while not showing it below. This is not a big deal if its not possible.

    Thanks

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