• I’m running WP 2.1 and the default Kubrick theme. I’d like one of my Pages to use an alternative bacground because I have no sidebar on that page. I’ve assigned a new template file to that Pages file successfully. This code in header.php looks like it should do exactly what I’m looking for (if there is no sidebar, show kubrickbgwide.jpg, which has no gray background).

    <?php
    // Checks to see whether it needs a sidebar or not
    if ( !$withcomments && !is_single() ) {
    ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg.jpg") repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
    <?php } ?>

    In my new template file, I’ve deleted

    <?php get_sidebar(); ?>

    but kubrickbg.jpg with the gray background still shows up.

    How do I trigger the “Checks to see whether it need sidebar” code?

  • The topic ‘Alternate background image on Pages (kubrick)’ is closed to new replies.