Answers for "wordpress if category page"

PHP
0

wordpress check if page

<?php
if (is_page( 'Page Title' ) ):
  # Do your stuff
endif;
?>
Posted by: Guest on June-07-2021
1

wordpress if is in category

// Find out in Wordpress (with PHP) if a single/page is in a chosen category
if (in_category('fruit')) {
    echo "This single/page is in category 'fruit'.";
}
Posted by: Guest on May-18-2021

Code answers related to "wordpress if category page"

Browse Popular Code Answers by Language