• Hi, I created a wordpress blog using Artisteer, it’s a nice program, but I need to customize further. I would like to use a different image for every sidebar header. What code do I use and where does it go? =) Thanks so much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t think you’re going to be able to do that without getting your hands dirty with some coding and creating some new classes for your theme’s stylesheet.

    Thread Starter tiffweb

    (@tiffweb)

    I’m up for that! If someone could show my some code samples, or get me started!!

    In that case, you’ll need to get to grips with WP conditionals so you can start putting together something like:

    <?php
    if( is_page('A')) $class='shead-a';
    elseif( is_page('B')) $class='shead-b';
    [...]
    else $class='none';?>
    <div id="sidebar class="<?php echo $class;?>

    Then you can add your different header images as CSS backgrounds using the individual generated classes.

    There’s also:
    https://quirm.net/2009/08/07/changing-headers-with-wordpress-body_class/

    In theory, you could use a similar approach and use the body class in your CSS along the lines of:

    body.category #sidebar url{background-image:url(images/header2.jpg;}

    That might save you some coding but I’ve not tried it yet myself.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to use an image for sidebar header?’ is closed to new replies.