get most recent posts based on a topic

SOLVE
Occasional Contributor

I am trying to pull recent blog posts on a blog post itself where the topic is the same one as the current topic.

what is the best solution to do that?

 

 

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Product Team
HubSpot Product Team

Hi @Robert

 

You can do this through the topic recent posts filter available here: http://designers.hubspot.com/en/docs/hubl/hubl-supported-functions#blog-recent-topic-posts

 

Hope this helps! 

4 Replies 4
Highlighted
HubSpot Product Team
HubSpot Product Team

Hi @Robert

 

You can do this through the topic recent posts filter available here: http://designers.hubspot.com/en/docs/hubl/hubl-supported-functions#blog-recent-topic-posts

 

Hope this helps! 

Highlighted
Regular Contributor

@Tom - how can this be extended to a multiple blog listing?

 

 

{% set blog_one_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- video --> 
{% set blog_two_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- article -->
{% set blog_three_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- infographic -->
{% set blog_four_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- report -->

{% set all_posts = (blog_one_posts + blog_two_posts + blog_three_posts + blog_four_posts) | sort(true, false, 'publish_date')  %} 

Then

 

 

{% for post in all_posts %}
Content here
{% endfor %}

 

Reply
0 Upvotes
Highlighted
HubSpot Product Team
HubSpot Product Team

Hey @sking1 this is somewhat different to this original issue. I'd advise you to open up a new post on our designers community to see if any designers there can assist! 

Reply
0 Upvotes
Highlighted
Regular Contributor
Reply
0 Upvotes