196 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 500+ items on Envato Market
  • Located in United States
ace2296 says

I want to have a different background for certain pages on my site.

<?php if (is_page('web-design') ):?> <style type="text/css"> body {background: url("http://www.bluesquidmedia.com/wp-content/uploads/2011/12/bg3.jpg") no-repeat scroll center 0 #000020;} </style> <?php }?>

I’m placing this code into my page.php… is there anything wrong with it? How can I accomplish this?

Thanks

214 posts
  • Has referred 1+ members
  • Has collected 50+ items on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Sells items exclusively on Envato Market
agusmu says

Hello ace, how are you? ;)

For example, I open the source code of your Portfolio page from my Firefox browser,

http://www.bluesquidmedia.com/portfolio/

and I saw this code for body tag,

<body class="page page-id-32 page-template page-template-template-portfolio-php gecko">
</body>

you can see page-id-32 body class here… ;)

so, go to Appearance > Editor and edit your style.css and add this code (for example)

body.page-id-32 {
     background: #000020 url("http://www.bluesquidmedia.com/wp-content/uploads/2011/12/bg3.jpg") no-repeat scroll center 0;
}

You can repeat this process for certain pages in your website… ;)

2213 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Sells items exclusively on Envato Market
+2 more
Graphic-Studio says

Maybe you will get more help if you post on Themeforest.net

There is possibly a plugin for this, but then again it depends on the theme you are using.

EDIT : maybe agusmu can help you though.

701 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Located in Canada
  • Has collected more than 1000 items on Envato Market
chrismccoy says

great plugin for this is called custom backgrounds, its on codecanyon, you can pick backgrounds for pages.

736 posts
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 more
mordauk says
3495 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says

^ haha ;)

Yes, using a plugin is probably the best way to accomplish what you want with the least amount of hassle.

2213 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Sells items exclusively on Envato Market
+2 more
Graphic-Studio says
sevenspark said
^ haha ;) Yes, using a plugin is probably the best way to accomplish what you want with the least amount of hassle.

Because without a Plugin – You will need to create specific php pages for each category or post articles.

Try a plugin first.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by