Add post type to Gutenberg Latest Posts
-
I have been using Custom Posts on https://flamel-forum.eu/ for a while. From the beginning, I have been struggling with having custom post types show up in the Gutenberg block Latest Posts. My solution was to add ‘post_type’ => array(‘post’, ‘custompost’) directly to the args of the function render_block_core_latest_posts in latest-posts.php (wp-includes > blocks). This works fine, generally, but has two disadvantages:
- The custom posts are still not shown in the backend, while other post types are.
- After any update of latest-posts.php, I obviously have to add the post type again.
My questions would be: where can I add the post type, so it also shows in the backend? And how can I trigger these changes via functions.php of my child theme, so they are update-safe?
The topic ‘Add post type to Gutenberg Latest Posts’ is closed to new replies.