Support » Themes and Templates » PHP Noob question

PHP Noob question

  • I’m trying to change some php code within my template to fit it to my needs better, and I have 1 small question:

    What’s the difference between:
    <?php if (is_single() get_sidebar()); ?>

    <?php if (!is_single() get_sidebar()); ?>

    What does the ! do in front of is_single?


Viewing 1 replies (of 1 total)
  • esmi


    Forum Moderator

    Reverses the logic.

    if (is_single() = if this is a single post
    if (!is_single() = if this is not a single post

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Noob question’ is closed to new replies.