Snippets: CPT

CPT to CPT Reverse Query

Reverse query from different post types associated via ACF relationship field.
ACF, CPT, WP Query | Type: PHP

Disable Gutenberg for selected Custom Post Types

function my_disable_gutenberg( $current_status, $post_type ) { // Disabled post types $disabled_post_types = array( 'book', 'movie' ); // Change $can_edit to false for any post types in [...]
CPT, PHP, WP/CP | Type: PHP

Eliminate Caching on Specific Page Templates and Post Types

Put in your theme’s header.php file: <?php   if (is_page_template('page_eventslist.php')) {     //conditional, if desired     header('Cache-Control: no-cache, no-store, must-revalidate');     header('Pragma: no-cache');     [...]
CPT, WP/CP | Type: PHP

Multiple Templates for Custom Post Type

Number of possible solutions; have not tested any of them yet. Maybe trying to make this too complicated: what about serving different template parts based on [...]
CPT, WP/CP | Type: PHP