The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

[Solved] WordPress: if page = single

  • # April 13, 2010 at 11:15 am

    I’m using wordpress. I want to add certain code to the header when someone is browsing an article page (which uses the page.php template). I’ve done something similar (not in wordpress) before by having this in the header:

    < ?php if ($current_page == "gallery") { ?>

    < ?php } ?>

    And this in the page:

    < ?php $current_page = "gallery"; ?>

    I’ve tried that but it’s not working in wordpress. Any ideas?

    # April 14, 2010 at 9:36 am
    < ?php if (is_page()) { ...stufff...
    # April 14, 2010 at 10:28 am

    This reply has been reported for inappropriate content.

    You forgot to close off the top line with ?>
    Here it is for anyone else who wants to know:



    Thanks a lot Chris.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed