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

  1. Max Sewell
    Posted 4 years ago #



    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,


    <?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;}
    <?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;}
    <?php endif; ?>

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

  2. Max Sewell
    Posted 4 years ago #

    Sorry. Found the answer.

  3. esmi
    Forum Moderator
    Posted 4 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