• Resolved marczr

    (@marczr)


    Hello I’m using the punchcut theme on a community site, I want to put a photo gallery on a page with no sidebar, I’ve made a page template to remove the sidebar but i can’t work out how to modify the css to have the content area full page width on the ‘no-sidebar’ page.
    I’ve added…

    #content_nosidebar {
    float: left;
    width: 960px;
    padding-bottom: 10px;
    }

    To the child theme style css, but the #content div is called from the header php file.
    how / what do I need to do to call the #content_nosidebar div for just the photo pages?
    Edit…here’s the page http://www.boulesonthegreen.org.uk/photos

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • you could use a conditional in your header.php
    http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template

    specifically if a page template is being used…
    so if page template photo page is being used
    <div id=”content_nosidebar”>
    else
    <div id=”content”>

    Thread Starter marczr

    (@marczr)

    Ok, that makes sense, except use of conditional tags is completely new to me, and I’m struggling with the correct format, I tried this… <?php if(is_page_template(<div id="content_nosidebar">)) ; else (<div id="content">); ?>
    And it just broke the page, is there any chance you could write out the php code in it’s correct syntax for me?
    Meanwhile I’l be googling for some tutes !

    Thread Starter marczr

    (@marczr)

    Sorted !

    here’s what I needed….

    <?php if (is_page_template('page-no-sidebar.php')) { ?>
      <div id="content_nosidebar">
    <?php } else { ?>
      <div id="content">
    <?php } ?>

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

The topic ‘alteing content div for unique page’ is closed to new replies.