WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] background for single post? (3 posts)

  1. Max Sewell
    Member
    Posted 2 years ago #

    http://bizbuzmarketing.com/wordpress/?p=1

    Hi,

    I've used the code below to incorporate a background for the home page and another other pages. I'd like to add the latter image for single posts (single.php). I"m not talking about a post background, but a background for the whole page displaying the post. Can anyone advise?

    Thanks for any help you can give,

    Max

    <?php if (is_home()): ?>
    	<style type="text/css">
    	body {background: url(http://bizbuzmarketing.com/wordpress/wp-content/themes/toolbox/images/bb-bkgd.jpg); background-position: left top; background-repeat: no-repeat;}
    	</style>
    <?php elseif (is_page() ): ?>
    	<style type="text/css">
    	body {background: url(http://bizbuzmarketing.com/wordpress/wp-content/themes/toolbox/images/bb-bkgd-2.jpg); background-position: center top; background-repeat: no-repeat;}
    	</style>
    <?php endif; ?>

    [Please post code snippets between backticks or use the code button.]

  2. Max Sewell
    Member
    Posted 2 years ago #

    Sorry. Found the answer.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    Try using the CSS classes generated on the <body> tag instead.

Topic Closed

This topic has been closed to new replies.

About this Topic