Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected

I’d recommend creating 3 separate [‘associated_items’] fields instead of 1. For Example: [‘associated_articles’] & “Filter for taxonomy term: Articles” [‘associated_presentations’] & “Filter for taxonomy term: Presentations” [‘associated_news’] & “Filter for taxonomy term: News” Note: Filtering for the taxonomy term, limits the related posts available to choose from as well, which results in a better user … Read more

Help on Custom Post Types

You want Posts 2 Posts which allows you to create many to many (or one to many or many to one) relationships between post objects — including custom post types. To related stores and deals you might do something like this… <?php add_action(‘p2p_init’, ‘wpse102461_connection’); function wpse102461_connection() { p2p_register_connection_type(array( ‘name’ => ‘stores_to_deals’, ‘from’ => ‘STORES’, // … Read more

If custom taxonomy else conditional [closed]

For custom post types use is_post_type_archive(‘tips’). Let us know if this works. It should also work with an array is_post_type_archive( array( ‘tips’, ‘cpt’, ‘another cpt’ ) ) I am currently using this function to recognize specific post type archives. See: A Post Type Archive in codex. It would be best if you could specify which … Read more

Get current page term title to use in WP_Query

Do what single_term_title does and check the queried object with get_queried_object. function single_tax_slug() { $term = get_queried_object(); if ( !$term ) return; if ( is_category() ) { $term_slug = $term->slug; } elseif ( is_tag() ) { $term_slug = $term->slug; } elseif ( is_tax() ) { $term_slug = $term->slug; } return $term_slug; } $slug = single_tax_slug(); … Read more