Support » Themes and Templates » Need help with conditional statement for comments

  • rughooker

    (@rughooker)


    I am customizing a template page and I want to show “Tell us what you think” on one category and the standard “Leave a comment” on all others. How do I do that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    <?php if( is_category('Name') ) :?>
    [ do one thing]
    <?php else :?>
    [ do something else ]
    <?php endif;?>
    rughooker

    (@rughooker)

    For my understanding, how would this statement changed if it is used in a function?

    esmi

    (@esmi)

    You would also have to use something like global $post; within the function to call the post object into the function so that its category can be checked.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need help with conditional statement for comments’ is closed to new replies.