Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter vivalazebra

    (@vivalazebra)

    okay so I made on each page custom field BodyClass and the value is whatever it correlates to like Contact, Pictures etc…

    Then I changed your code to the following…

    <body<?php if ($BodyClass) echo ‘ class=”‘ . $BodyClass . ‘”‘; ?>>

    which I think isn’t right…

    then I went into the stylesheet to change the header image on the contact page and entered:

    .BodyClass #contact { background: url(‘images/zebra_header.jpg’) no-repeat; }

    But no love… any suggestions of what I messed up ?? thanks

    Thread Starter vivalazebra

    (@vivalazebra)

    Thank you for your patience on this,

    So Im using permalinks with page id’s so for example my contact page is ?page_id=17
    with your code in place when I go to my stylesheet and add the code would it need to look like this…

    .?page_id=17 #pic { background: url(‘images/zebra_header_3.jpg’) no-repeat; }

    also in my header file it looks like this with you code in place will it not work with the other code below it?

    <?php wp_head(); ?>
    </head>
    <?php
    $page = ”;
    if (is_front_page() ) {
    $page = ‘home’;
    } elseif (is_page()) {
    $page = $wp_query->query_vars[“pagename”];
    }
    ?>
    <body<?php if ($page) echo ‘ class=”‘ . $page . ‘”‘; ?>>

    <div id=”container”>

    <div id=”page” class=”blog”>

    <div id=”header”>
    <h1>“><?php bloginfo(‘name’); ?></h1>
    <div id=”nav”>

    </div>
    <div id=”pic”></div>
    </div>

    Thanks again dont mean to seem thick headed Im normally a quick learner just the pressrow code is kinda jumbled.

    Thread Starter vivalazebra

    (@vivalazebra)

    With the code you sent

    <?php
    $page = ”;
    if (is_front_page() ) {
    $page = ‘home’;
    } elseif (is_page()) {
    $page = $wp_query->query_vars[“pagename”];
    }
    ?>
    <body<?php if ($page) echo ‘ class=”‘ . $page . ‘”‘; ?>>

    Do I need to alter anything in the code? Or just update my CSS… for example say I made a pictures link and the page id is 12

    do I enter this into my css to change the header image?

    .pictures #pic { background: url(‘images/zebra_header_mid.jpg’) no-repeat; }

    thanks for your help and sorry still new to css and php.

    Thread Starter vivalazebra

    (@vivalazebra)

    Thanks stvwlf, can you look at my header code below and let me know where I should place it

    <?php wp_head(); ?>
    </head>
    <body <?php if (function_exists(‘body_class’)) body_class(); ?>>

    <div id=”container”>

    <div id=”page” class=”blog”>

    <div id=”header”>
    <h1>“><?php bloginfo(‘name’); ?></h1>
    <div id=”nav”>

    </div>
    <div id=”pic”></div>
    </div>

    Do I just take out —

    <body <?php if (function_exists(‘body_class’)) body_class(); ?>>

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