192 posts
  • Bought between 100 and 499 items
  • Has been a member for 4-5 years
  • 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

211 posts
  • Has been a member for 5-6 years
  • Bought between 50 and 99 items
  • Referred between 1 and 9 users
  • 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… ;)

1989 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 000 and 5 000 dollars
  • Author had a Free File of the Month
  • United States
  • Bought between 100 and 499 items
  • Referred between 10 and 49 users
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
  • Bought between 1000 and 4999 items
  • Canada
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
chrismccoy says

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

730 posts
  • Elite Author
  • Attended a Community Meetup
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Most Wanted Bounty Winner
+2 more
mordauk says
3362 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 50 and 99 items
  • Referred more than 2000 users
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says

^ haha ;)

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

1989 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 000 and 5 000 dollars
  • Author had a Free File of the Month
  • United States
  • Bought between 100 and 499 items
  • Referred between 10 and 49 users
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.

by
by
by
by
by
by