Support » Installing WordPress » <?php } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • In php, you can set conditions for when to do something. For instance, is_search() in WordPress will be true anytime the page being displayed is a search page. To execute code when it is true you use brackets {}. These brackets can cover multiple lines and you can put normal ol’ html in between if you like. For instance:

    <?php is_search() { ?>

    <!-- notice no closing bracket -->
    You're currently looking at a search page.

    <?php } ?>

    So all that inside those will only display when those conditions are true. If you’re interested (which I doubt, since that seemed just an idle question) there’s more info in the Codex.

    And that’s where lonely brackets come from.

    Weird thing, I haven’t seen this construction yet

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘<?php } ?>’ is closed to new replies.