• Hi,
    im trying to put an background-image to my home (which is an page assigned to home) and another one to all the other pages and posts.
    Does anyone know a thread a site or a solution how this is solved?
    thnx
    kns

Viewing 9 replies - 16 through 24 (of 24 total)
  • hmm okay i’ll see what i can do with this…. thank you so much i am so over my head ?? honestly have no clue what i’m doing other than following directions ?? i’m a point and click kinda girl ??

    still having trouble with links… someone suggested trying it in the header, but that didn’t seem to work either

    hi PBP_Editor
    I have the atahualpa theme and i have the same problem to Change Background Image per page.

    if i put this code
    backticks<?php if (is_page(‘4’) ): ?>
    <style type=”text/css”>
    body {background-image:url(images/bg-page4.jpg);}
    </style>

    <?php elseif (is_page(‘5’) ): ?>
    <style type=”text/css”>
    body {background-color:#ffffff;}
    </style>backticks

    at the top of the css.php appears a parse error.

    Where i do put that code
    Thanks a lot

    Found this. maybe it helps some.
    works good on my site. i made it select random images for my header bg.

    https://ma.tt/scripts/randomimage/

    Hi there, i am trying to create image background for different pages, i want each page to have it’s own background, can any one try to see if what i have done is correct, it not showing me what want, bellow is the code and it is in my header.header.php

    <style type=”text/css”>
    <?php $page_id=get_the_ID();
    if(is_page()) { $image=’partners’.$page_id=’2′.’.jpg’;
    if(!file_exists(TEMPLATEPATH.’/images/’.$image)) { $image=’partners.jpg’; }
    echo ‘#page { background-image: url(images/’.$image.’); }’; }; ?>
    </style>

    Please help.

    Hi, i want to change the content_wrap section to a different image background per page. I tried the above just changing the background and it worked, but on the website im working i want one static background colour and the image in the content_wrap section to change.

    so instead of body {} i changed it to content_wrap{} but it didnt work. any idea? for example:

    <?php if (have_posts()) : ?>

    <?php $cat_obj = $wp_query->get_queried_object(); $cat_id = $cat_obj->cat_ID; ?>

    <?php if (in_category(‘1001’) ):
    // category 1001 ?>
    <style type=”text/css”>
    content_wrap {background-color:#000;background-image:url(/images/background.jpg);background-repeat:repeat;}
    </style>

    <?php elseif (in_category(‘1002’) ):
    // category 1002 ?>
    <style type=”text/css”>
    content_wrap {background-color:#000;background-image:url(/images/background2.jpg);background-repeat:repeat;}
    </style>

    <?php endif; // end the if, no images for other other categories ?>

    dont worri i figured it out. from the aboce the body didnt have a # infront of it, i just put #content_wrap and it worked. no need to reply@!

    I am having problems with the BG image not showing up. BG colour works. here is the code:

    <?php if (is_page(‘photography’) ): ?>
    <style type=”text/css”>
    body {background-image:url(<?php bloginfo(‘template_url’); ?>/library/styles/custom/img/texture_bg1.jpg) repeat top center;}
    </style>

    The complete path is:
    https://localhost:8888/wordpress/wp-content/themes/shapeshifter/library/styles/custom/img/texture_bg1.jpg

    Any help would be appreciated.

    best,

    rob

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Change Background Image per page’ is closed to new replies.