201 posts
  • 6 Years of Membership
  • Collector Level 5
  • 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
  • Affiliate Level 1
  • Collector Level 3
  • 6 Years of Membership
  • Exclusive Author
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… ;)

2605 posts
  • Weekly Top Seller
  • Top Monthly Author
  • Moderator
  • 6 Years of Membership
+8 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
  • 7 Years of Membership
  • Affiliate Level 1
  • Canada
  • Collector Level 6
chrismccoy
says

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

737 posts
  • Affiliate Level 7
  • Author Level 8
  • Collector Level 3
  • Top Monthly Author
+9 more
mordauk
says
3535 posts
  • Power Elite Author
  • Author Level 12
  • Trendsetter
  • United States
+13 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.

2605 posts
  • Weekly Top Seller
  • Top Monthly Author
  • Moderator
  • 6 Years of Membership
+8 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