• Resolved hugandplay

    (@hugandplay)


    Much like this solution for showing certain shortcodes on specific pages, I wonder if it’s possible to show certain shortcodes based on what category the page is in.

    Kind regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author AccountClosed

    (@wistudatbe)

    I suppose it’s possible and let you know the results when ready.
    Regards, Danny

    Thread Starter hugandplay

    (@hugandplay)

    Amazing, thank you.

    Plugin Author AccountClosed

    (@wistudatbe)

    Hello,
    Here my solution:

    
    $terms = get_the_terms( $post->ID , 'categories' );
    if(empty(!$terms)){
        echo do_shortcode('[wudcatdrop]');
    }
    

    Paste this code in your page template file, where you want to show the result(s).

    You can change the shortcode to one of the samples described in the Admin section from my plugin.

    Regards,
    Danny

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category variable in PHP’ is closed to new replies.