Recent Posts shortcode with IDs

Hi there,

we want to use the recent posts shortcode but to show selected posts by IDs. That is the code we used: [recent_posts count=“3” id=“6337, 6241, 5198”]

Is that possible? If yes, how does that work? If no, is there an alternative?

Best regards

Hello, @knowmates,

Thanks for writing to us.

The ID option of the Recent Posts shortcode is not for the post ID, It will add a unique Id in the output markup(HTML Frontend ) of the shortcode.

To display posts based on the posts ID from the shortcode, it would require custom development.

You can try the Essential Grid plugin to display posts by post ID. Please have a look at the screenshot given below.

To learn more about Essential Grid setting and setup please have look at our doc.


https://www.themepunch.com/essgrid-doc/custom-wp-queries/

Thanks

Hi there,

thanks for your answer but I don’t want to use the Essential Grid just to show some blog posts.

Is there any other way to show individually selected posts by ID using a shortcode (with the look of the recent posts shordcode/element)?

Best regards

Hi @knowmates,

In our next release there will be a new Post element with greater flexibility in terms of showing different posts with custom styles. To get the effect you’re looking for you would need to add the new element multiple times, (one for each ID) but you would have full control over the look of each post. I can’t give an ETA on when it will be available, but we’re shooting for a beta around the end of this month.

Meanwhile, you could check out this plugin: https://wordpress.org/plugins/display-posts-shortcode/

1 Like

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