- This topic has 4 replies, 2 voices, and was last updated 2 years, 1 month ago by Brian.
-
AuthorPosts
-
July 16, 2022 at 8:55 am #2284589Brian
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
July 16, 2022 at 11:26 am #2284658YingStaffCustomer SupportHi 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/7o9NwaNlCT2. 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/YwUSoTnN3. Go to customize > layout > blog, tick the
Make first post featured
box andDisplay posts in columns
box.July 19, 2022 at 11:27 am #2287704BrianThanks 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 ๐
July 19, 2022 at 12:10 pm #2287747YingStaffCustomer SupportGlad you found a way ๐
July 20, 2022 at 8:39 am #2288673BrianI 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
Also I had it working like this
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
-
AuthorPosts
- You must be logged in to reply to this topic.