Feb 15, 201811:49 AM - edited Feb 15, 201811:54 AM
Contributor | Platinum Partner
Exclude the most recent post from "featured" topic on blog listing page (listing template)
SOLVE
I'm currently building a blog listing page template that has a featured post at the top full-width. It pulls the most recent posts tagged with "featured". This is build in a custom HubL module.
Then below this custom HubL module, I have the normal blog content module, formatted to put the posts in rows of 3.
I have all that working great. However, the featured post is also showing up in the blog content module (listing template).
Here is my code so far. Please keep in mind I'm completely new to HubL.
and it did hide the featured post, but then it messed up the formatting. It kept the first 3 in a row, but all after that were not getting wrapped in the .grid-row div.
Exclude the most recent post from "featured" topic on blog listing page (listing template)
SOLVE
Actually, I'm just going to close this posts. I had put wrapping divs around every 3rd post to put into rows of 3. Even if I use an {% unless %} statement to hide a any post with a certain topic assigned, it still gets counted as a loop iteration. I was really hoping to only hide the most recent post from the featured topic, but I'll just settle for hiding all featured posts.
So I'm going to remove the wrapping divs on every 3rd post and just use the css grid layout to achieve what I'm wanting.
Exclude the most recent post from "featured" topic on blog listing page (listing template)
SOLVE
Ok, just threw me off cuz you said hey @gregorsmith , which is not me.
But anyways, I can share a link, but I already posted my HubL code, so not sure how much seeing the front end is going to help. I'm not having a styling issue, it's a logic issue with the loop.
Exclude the most recent post from "featured" topic on blog listing page (listing template)
SOLVE
Actually, I'm just going to close this posts. I had put wrapping divs around every 3rd post to put into rows of 3. Even if I use an {% unless %} statement to hide a any post with a certain topic assigned, it still gets counted as a loop iteration. I was really hoping to only hide the most recent post from the featured topic, but I'll just settle for hiding all featured posts.
So I'm going to remove the wrapping divs on every 3rd post and just use the css grid layout to achieve what I'm wanting.
Your solution helped, but I'd like to overcome the post-count issue. I have post listing pages set to show 9 posts - so when my featured post is removed, the first page only shows 8. Is there a way to overcome this? I've temporarily set to show 10 as a quick fix... but long term that will set additional pages to have one too many posts.
It also stinks that we have to remember to remove the featured tag from older posts as we assign to new ones... so that they can be seen in the listing. Were you able to find a way to say don't show the first post tagged featured?