• Hello everyone, I am having an issue with a page template. So here is the issue, I went ahead and created a new page template, renamed and removed the sidebar by deleting a bunch of atomic php lines.

    Now the original default page template is retrieving the background from a picture. I went ahead and modified the picture, the original pic name was “bg-container” so I called this modified pic bg-container1. Now if I locate the #container tag in the CSS and change from bg-container to bg-container1 it works perfectly except it applies this to every page. So I went ahead and inserted this line at the end of the css file

    .page-template-nosidebar .container{overflow:hidden;width:980px;margin:30px auto 0;background:url(images/bg-container1.png) repeat-y}

    I did this with a previous page and it has worked fine but for some reason it doesn’t work with this one. What am I doing wrong, it seems the only way I can change this background image is to change the main image which changes all of them. Can anyone tell me how I can apply this modified image to my page template?

Viewing 5 replies - 1 through 5 (of 5 total)
  • From what you have written it should be #container .page-template-nosidebar…

    Depends on your ids and classes.

    Best wishes

    Thread Starter maxpayne13

    (@maxpayne13)

    #container .page-template-nosidebar{overflow:hidden;width:980px;margin:30px auto 0;background:url(images/bg-container1.png) repeat-y}

    this does not work, sorry :(.

    this is my page right now

    https://216.172.171.18/~carranza/test6/?page_id=1209/

    Thread Starter maxpayne13

    (@maxpayne13)

    basically I modified the entry content without any issues but I can;t seem to apply this container tag to a new template

    according to basic rules of css:

    .page-template-nosidebar1 #container {}

    please use a tool such as Firebug https://getfirebug.com/ or similar for these kind of formatting problems.

    https://www.w3schools.com/css/

    Thread Starter maxpayne13

    (@maxpayne13)

    Thanks alchymyth, that worked perfectly. I guess I need to brush up on my CSS skills.

    One last question, I removed these lines from my page to remove the side bar, will this cause problems?

    <?php do_atomic( ‘before_content’ ); // Before content hook ?>

    <div id=”content”>

    <?php do_atomic( ‘open_content’ ); // Open content hook ?>

    and approx 5 lines down, this line

    <div id=”post-<?php the_ID(); ?>” class=”<?php hybrid_entry_class(); ?>”>

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘modifying CSS for custom page template’ is closed to new replies.