Changing background
-
Is there a way to change wordpress background. I would like to a different background for each page in my wordpress site.
How to do so ?
Thanks.
-
Hi,
maybe try this:
http://codecanyon.net/item/styles-with-shortcodes-for-wordpress/142221
it’s not mine but you can test it. there’s also a demo login.It’s nice. but I have not find a way to place different background in different page yet (not in the same page).
This article explains how to change page headers using the body_class. You should be able to do the same thing with the body background.
thanks.
I place this code in style.css:
body #page {
background_color: #FFFFFF;
background_image: url(http://localhost/wordpress/wp-content/uploads/2011/05/Projects.jpg);
background_repeat: no-repeat;
background_position: left;
}body.profile #page.url {background_image.url(http://localhost/wordpress/wp-content/uploads/2011/05/Image1.jpg};
body.services #page.url {background_image.url(http://localhost/wordpress/wp-content/uploads/2011/05/Image2.jpg};
and where should I replace <body> with:
<body <?php if (function_exists(‘body_class’)) body_class(); ?>>
?
In header.php
Well, now nothing appears.
Before I place the above code, I placed the following codes:
body #page {background:#FFFFFF url(http://localhost/wordpress/wp-content/uploads/2011/05/Projects.jpg) no-repeat left}
Some of the page names are: profile, services.
I did replaced:
<body <?php body_class( pagelines_body_classes() ); ?>>
with:
<body <?php if (function_exists(‘body_class’)) body_class(); ?>>
Ah – now you didn’t mention that there was already a theme-specific function on the body tag. You need to look into that pagelines_body_classes() function.
The following message appear after I pressed the Lookup button:
No documentation available for pagelines_body_classes()
That function is specific to your theme. You need to actually look at the code in functions.php.
functions.php
<?php
/*THEME INITIALIZATION
This file loads the core framework for Platform which handles everything.
This theme copyright (C) 2008-2010 PageLines
*/
require_once(TEMPLATEPATH . “/core/core.init.php”);
core.init.php
[Code moderated as per the Forum Rules. Please use the pastebin]
why don’t you ask the guys where you bought the template. (pagelines)
Hey, I found the answer:
/* Profile page-id-14 */
body.page-id-14 #page {background:#FFFFFF url(http://localhost/wordpress/wp-content/uploads/2011/05/Profile.jpg) no-repeat left}/* Services page-id-42 */
body.page-id-42 #page {background:#FFFFFF url(http://localhost/wordpress/wp-content/uploads/2011/05/Services.jpg) no-repeat left}/* Projects page-id-46, 49, 56 */
body.page-id-46 #page {background:#FFFFFF url(http://localhost/wordpress/wp-content/uploads/2011/05/Projects.jpg) no-repeat left}Except for Projects page, since it consist of many pages (still inherited by Projects menu item), it would not be flexible for the new users to add extra page by himself since one will still have to modify the style.css to maintain the picture existance.
Anyway, thanks for helping.
The topic ‘Changing background’ is closed to new replies.