Create sub posts for a WordPress custom post type
This has to do with creating hierarchical CPTs, so you can have ‘sub-posts’ as children of a CPT single.
CPT, WP/CP | 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
Disallow Indexing of PDFs in Media
Important if PDFs are only available behind login or downloadable after transaction.
¡Important!, eCommerce, WP/CP | Type: Other
Display Debugging status on Admin Bar
Code shared by CodePotent; goes in your theme functions file. function codepotent_debug_notifier_register_admin_bar() { if (!current_user_can('manage_options')) { return; } global $wp_admin_bar; $label = esc_html__(' Debugging DISABLED ', 'codepotent-debug-notifier'); if [...]
WP/CP | Type: PHP
Display Featured Image on Listing
How to add featured image to other post types. ADD TO THEME FUNCTIONS // This theme uses post thumbnails add_theme_support( 'post-thumbnails', array( 'plans','listings','news','post' ) ); ON [...]
Images, PHP, WP/CP | Type: PHP
Display the Title for the Posts / Blog Page
You can’t use the standard the_title(); template tag for the page name of the page that displays the blog listing (index.php); that tag will display the [...]
PHP, Template Tags, 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
Event Listing Ordered by Date
Basic events listing, ordered by date, past events disappearing.
ACF, WP Query, WP/CP | Type: PHP
Filter Custom Post Type by Custom Fields
Can be found on an Evo blog post with more explanation.
ACF, PHP, WP Query, WP/CP | Type: PHP
Filter Custom Post Type by Taxonomy
UPDATE: Moving to PHP8 from PHP7.4, there was a problem with the format of the original filter form throwing an error. I have not tested this [...]
PHP, WP Query, WP/CP | Type: PHP