Related posts code to include post id

Hello!
I added a recent post code to my blog post [recent_posts count=“3” ]
I want to hand pick which posts to display.
I think I need to include post id.

What is the proper way to do that?

For example, I want to include post id 1006, 319 and 369

Thank you!

Hello @nadynad,

Thanks for writing in!

From the name itself, Recent Posts element will display the latest or recent post items in your site. This element cannot be used to display selected post items. You may need to find other 3rd party plugin that will do the handpicking of the post items to accomplish what you have in mind.

Regards.

Thanks for your reply.

But I was under impression that I can do that after reading X-theme demo here: http://demo.theme.co/integrity-1/shortcodes/recent-posts/

If you scroll all way down, you can see:
"Options

  • id: add a unique ID to the shortcode.
  • class: add a class or multiple classes to the shortcode.
  • style: add inline styles to the shortcode.
  • type: “post” or “portfolio.”
  • count: “1,” “2,” 3,” or “4.”
  • category: to filter your posts by category, input the slug of your desired category; also accepts multiple category slugs separated by a comma to display posts in any of those categories, or multiple category slugs separated by a plus sign to display posts that have all of those categories.
  • offset: input a number to select the initial offset of posts."

My question is if I cannot handpick each post, what is the proper way to select just one category? or to offset?
What do I add to this code: [recent_posts count=“3” ]?

Thank you,
Nadia

Hello Nadia,

You can use something like if you want to display post items with the same category:

[recent_posts count="3"  category="articles"]

The offset is useful if you want to display 8 or 12 post items of the same category. For example:

[recent_posts count="3"  category="articles"]
[recent_posts count="3"  category="articles" offset="4"]
[recent_posts count="3"  category="articles" offset="8"]

The offset is needed in displaying 12 items because you can only display up to 4 items in each recent post element.

Hope this explains it briefly.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.