• Resolved insanoff

    (@insanoff)


    I wrote a code that when there is a category with the name of the page shows more from this category. The problem about that when the category does not exist shows error. How to check?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter insanoff

    (@insanoff)

    <?php if ( is_term( 'name_of_category' , 'category' ) ){
    return true;
    }?>
    uwiuw

    (@uwiuw)

    btw, you can use this function

    if (category_exists($the_category_name)) {
    …do your code here…
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to know whether there is the category with the name?’ is closed to new replies.