• Skip to main content
  • Skip to primary sidebar

WordPress, Genesis Framework and Storefront customization tutorials

  • Free
  • Premium
  • Membership
    • Login
  • Design
  • Blog
  • About
  • Contact
Home » Echo something conditionally on the single page of specific Custom Post Type Taxonomy

Echo something conditionally on the single page of specific Custom Post Type Taxonomy

2020-02-29 by Gabor Leave a Comment

// ==================================================================
// SINGLE PAGE OF SPECIFIC CPT TAXONOMY
// ==================================================================
function single_page_of_specific_cpt_taxonomy(){
    global $post; 
    if(is_singular('YOUR_CPT')){
       foreach (get_the_terms(get_the_ID(), 'YOUR_TAXONOMY') as $cat) {
           //echo $cat->slug;
           if($cat->slug === 'YOUR_TERM'){
               echo 'YEAHHH!!!!';
           }
        }
    }
}
add_action('genesis_entry_content', 'single_page_of_specific_cpt_taxonomy');

Filed Under: Free Tagged With: CPT

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube
WP Rocket - WordPress Caching Plugin
UpdraftPlus Premium

Disclosure: Some of the links in this site are affiliate links. I will be paid a commission if you use this link to make a purchase.

  • Privacy Policy
  • Terms of Service
  • Flames Design
© 2021 WP Flames - All Right Reserved