StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-06-2012, 08:09 PM
BadJesus BadJesus is offline
Registered User
GenesisConnect
Genesis Member
 
Join Date: Mar 2012
Posts: 39
Default Hook inside the body tag or #wrap div for CSS Style

I want to use custom fields for an UBER simple to use backend.
I can't seem to figure out how to change the style property for either the body tag or the #wrap div.

The only thing I can think of is adding a custom style class embedded into the header & calling my custom post type inside of a class.

So it would be


Quote:

<style type="text/css" media=screen>
body.custom_body1 {background:url("<?php my_custom_field(); ?>") no-repeat top center transparent;}
</style>

Then using Wordpress' built in custom body class filter...

Code:
// Add specific CSS class by filter
add_filter('body_class','my_class_names');
function my_class_names($classes) {
	// add 'class-name' to the $classes array
	$classes[] = 'custom_body1';
	// return the $classes array
	return $classes;
}

this just seems a bit sloppy though. Is this actually the best way to accomplish this?

Sorry if this doesn't make any sense, it does in my head. :)

Thanks!
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:01 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.