Classic Element "Recent Posts" only for blog posts?

Just curious if the classic element “Recent Posts” will only show the native posts? I have a CPT I built titled “projects” using CPTUI, but I only see “posts” in the dropdown.

Hi @designerken,

By default recent post doesn’t support CPT. It can be adjusted by custom code on child theme’s functions.php file, though if you’re not familiar with coding, I don’t recommend it.

I suggest using ESSENTIAL GRID instead. It is a bundled plugin with skin editor function. It is easy to build using that plugin and it also offers other options and flexible grid layouts.

Hope this helps.

Hi @Lely

I appreciate the link to the code.

Looks like it is as simple as the code from @RueNel further down on that page.

// =================================================================== // Add post type to recent post element // =================================================================== function add_post_type_to_classic_recent_posts_element( $types ) { $types['my_post_type'] = 'my_post_type'; $types['another_post_type'] = 'another_post_type'; return $types; } add_filter( 'cs_recent_posts_post_types', 'add_post_type_to_classic_recent_posts_element', 999 );

Thanks again.

You’re most welcome, @designerken.

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