WordPress.org

Ready to get started?Download WordPress

Forums

different backgrounds in wordpress pages (4 posts)

  1. iguanna2
    Member
    Posted 5 years ago #

    Anyone could help me? I'm trying to have a different background for each page on my wordpress, any idea?

  2. esmi
    Forum Moderator
    Posted 5 years ago #

  3. andytford
    Member
    Posted 5 years ago #

    Elliot Jay Stocks had a post on this sometime back. Scour the web for that. You can hack with CSS, a bunch of jpegs and a little code in the header.

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    Something like:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php if(is_page('foo')) $page_style='foo';
    elseif((is_page('bar')) $page_style='bar';
    else $page_style='';
    ?>
    <div <?php post_class($page_style); ?>>

    should work and generate page specific classes that can then be used to style the background via CSS.

Topic Closed

This topic has been closed to new replies.

About this Topic