Adding an edit tag in PHP conditional»
Add [EDIT] in a PHP conditional, with style tags surrounding
PHP, WP/CP | Type: PHP
Common WP functions converted to variables»
Sometimes functions are easier to use in conditional statements if converted to variables.
ACF, PHP, WP/CP | Type: PHP
Conditional Based on Field Value»
Conditional based on values for single-value fields (radio buttons, select, etc).
ACF, PHP | 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 the disabled post types…
CPT, PHP, WP/CP | Type: PHP
Display Dates if Start and End Dates Same Month»
Handy snippet for displaying event dates when events can stretch over multiple days.
ACF, PHP | 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 POST-TYPE SPEC 'supports' =>…
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 latest blog post title…
PHP, Template Tags, 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»
Can be found on an Evo blog post with more explanation.
PHP, WP Query, WP/CP | Type: PHP
More WordPress tags to PHP Variables»
$pix = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); $title = get_the_title( $ID ); $eventlink = get_the_permalink(); $excerpt = get_the_excerpt(); $url = get_template_directory_uri();
PHP | Type: PHP