WordPress.org

Support

Support » Themes and Templates » Forcing a non-page to be displayed singlecol

Forcing a non-page to be displayed singlecol

  • I’m trying to integrate the flickr gallery plugin into my website and after getting the plugin to work, I’ve gotten the template page to display properly. The problem is, when you click on one of the gallery links (really flickr sets) you don’t get a singlecol page because header.php doesn’t think it should be a singlecol page. I know that the offending code is:


    <div id="container"<?php if ( is_page() && !is_page("archives") ) echo " class=\"singlecol\""; ?>>

    But after trying a couple things, I’m at a loss as to how to fix it…

Viewing 1 replies (of 1 total)
  • to answer my own question, I finally got the evaluation to work as I expected.
    I got all my parenthesis in the right places, used a perl regex match, and wham! it works:

    <div id="container" <?php if ( ((preg_match('/gallery/',$_SERVER['PHP_SELF'])) || is_page()) && !is_page("archives") ) echo " class=\"singlecol\""; ?>>

Viewing 1 replies (of 1 total)
  • The topic ‘Forcing a non-page to be displayed singlecol’ is closed to new replies.
Skip to toolbar