• I have created different templates for content that I want to use in pages.

    I create the page and apply the template I would like to use.

    What I want to get rid of is the CSS styles that apply to the rest of the site. What is happening is that I have a gallery program and when I click on the thumbs to enlarge the pictures the large versions of the pics are blocked by the sidebar image that the theme uses.

    How do I “disconnect” the sidebar CSS from the new page templates? I obviously took out the get_sidebar so the content isn’t there, just the sidebar image called for.

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter archaeologyman

    (@archaeologyman)

    bump…anybody?

    Unfortunately it’s not that simple.
    That bg image is called in the “main” div of the layout and I assume it starts in the header.php template file. What it means: every webpage in your blog is using the header.php, so the bg image is present everywhere.
    It would mean quite a bit of work on several template files – or applying some if_statements to show it conditionally.

    Thread Starter archaeologyman

    (@archaeologyman)

    Thanks moshu.

    What you described is in fact the case.

    “It would mean quite a bit of work on several template files” I don’t mind working changing around a template file, it’s the if_statements I wouldn’t even attempt.

    Any suggestions on what to do with the template?

    The thing is it’s easier to do (for me) than to explain ??
    If the if statements (like if is_page >> do this and that = see Conditional_Tags) are not an option, then you would have to “slice” the theme files at a different point, so that the “main” div starts in index, archive, page, single etc. template files (as opposed to the header.php where it is now), so that you can apply a little bit different divs in them, e.g. changing the “main” div in page.php to “divpage” and writing different rules for it in the CSS.

    If it helps, I have a visual anatomy showing how the templates are ‘sliced’…

    Thread Starter archaeologyman

    (@archaeologyman)

    moshu-

    O.K. First, I know essentially know nada about PHP.

    Let me see if I am on the right track here with the if_statements:

    In the template page I would put the following:

    \<?php
    /*
    Template Name: Blank Template
    */
    ?>

    <?php get_header(); ?>

    // let’s generate info appropriate to the page being displayed
    if (is_page(photo-page))\

    Is this the right track? If so, where to go from there?

    Thanks

    Not exactly…
    Template Name: Blank Template <== this one is needed only for the second (third etc.) Page template, the default Page template (=page.php) is recognized automatically by WP.

    It doesn’t matter whether you make a new Page template or not – if it starts with calling the header.php which, as it does now, will call in the bg image for the sidebar.

    Did you take a look at the “anatomy”? – I am afraid you didn’t.
    I cannot explain better than it is presented there. In my example after the body comes the “rap” div… which has a similar function like the “main” div in your theme.
    It is not PHP, it’s basic HTML.
    While looking at my anatomy, imagine that an original complete index file was cut in 3 pieces:
    – header
    – index
    – footer
    The index portion (Main template) will be replaced every time when WP recognizes there is a specialized template:
    archive – for listing old posts
    page – for “static” Pages
    single – for one post… etc.

    The issue is: WHERE the header and the index portion were cut apart. If the starting tag of a HTML div is in header.php ==> it will be in every webpage.
    Practically, if you don’t go by the Conditional_Tags you have to move the “cut-line” between the header and the rest of the template files (ALL!) up several lines.

    [I warned you it’s difficult to explain if someone doesn’t have a mental picture of the template files coming together in a theme…]

    Thread Starter archaeologyman

    (@archaeologyman)

    Thanks moshu. I guess I was concentrating on trying to learn the PHP side of it. I’m off to study your image page carefully. I’ll be back ??

    Thanks

    Thread Starter archaeologyman

    (@archaeologyman)

    What goes in the rap div?

    And no matter where the get_header is called it will always inlcude the sidebar image.

    Am I to call an alternate header?

    You don’t have a rap div – as far as I remember (you have “wrap”).
    But your problem is the “main” div – that’s the one that in the stylesheet is defined as having the blue sidebar image.

    If you want to proceed with this one – you will have to “cut” your header.php above the “main” div = making it to end with the line just before the main…
    and whatever is cut out you’ll have to move into the top if the index, archive, page, single files: just below the get_header line.
    Then rename the main div to something else in the page.php and define its properties in the stylesheet.

    Calling an alternate header.php could also work, but you still have to do the renaming “main” and define it procedure…

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Template issue’ is closed to new replies.