200 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

223 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… ;)

2577 posts
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 6 years
  • Has sold $1,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+6 more
Graphic-Studio
Moderator
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.

737 posts
  • Has referred 1000+ 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
3532 posts
  • Had an item that was trending
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
+11 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.

2577 posts
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 6 years
  • Has sold $1,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+6 more
Graphic-Studio
Moderator
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.

by
by
by
by
by
by