• ezombie

    (@ezombie)


    Does anyone know if there is a way to change the #main.wrapper background-image for different pages? Most of my pages have a white background, but one of them needs to use a tiled image. I’m using a child-theme of twenty-twelve, but can’t post a link to the site yet.

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    (@esmi)

    Try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. Or use whatever developer tool is available in your web browser.

    Thread Starter ezombie

    (@ezombie)

    Thanks esmi,

    I have done that, that’s why I’m here. If I change the background on #main.wrapper it changes it for all of the pages. I need to change it for just one. I also can’t just call a post ID in CSS because this will be a blog feed resulting in multiple dynamic pages of a single category. I think this might require a change in a PHP file, but I’m very inexperienced in writing PHP. I’ve been playing around with this code trying to add another div layer “blog-background” but it hasn’t been working.

    ` <?php
    /**
    * Template Name: Page of Posts
    *
    * for a child theme of Twenty_Twelve
    */

    get_header(); ?>
    <div id=”blog-background” class=”site-content-blog” style=”background-image: url(http://www.ortnergraphics.com/hvcurrent/wp-content/uploads/2014/04/current-logo-tile_03.png); background-repeat:repeat;>
    <div id=”primary” class=”site-content”>
    <div id=”content” role=”main”>

    <?php
    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    $args= array(
    ‘category_name’ => ‘Living on Currents’, // Change this category SLUG to suit your use; or see for query parameters http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
    ‘paged’ => $paged
    );
    query_posts($args);
    if( have_posts() ) :?>

    <?php while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( ‘content’, get_post_format() ); ?>
    <?php comments_template( ”, true ); ?>
    <?php endwhile; // end of the loop. ?>

    <?php twentytwelve_content_nav( ‘nav-below’ ); ?>

    <?php else : ?>
    <article id=”post-0″ class=”post no-results not-found”>
    <header class=”entry-header”>
    <h1 class=”entry-title”><?php _e( ‘Nothing Found’, ‘twentytwelve’ ); ?></h1>
    </header>
    <div class=”entry-content”>
    <p><?php _e( ‘Apologies, but no results were found. Perhaps searching will help find a related post.’, ‘twentytwelve’ ); ?></p>
    <?php get_search_form(); ?>
    </div><!– .entry-content –>
    </article><!– #post-0 –>

    <?php endif; wp_reset_query(); ?>

    </div><!– #content –>
    </div><!– #primary –>

    <?php get_sidebar(); ?>
    </div> <!–blog-background–>
    <?php get_footer(); ?>`

    I’m really hoping someone can help me with this, the project is for a non-profit org and I’m not making any money on it.

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

The topic ‘Change #main.wrapper background-image for specific pages’ is closed to new replies.