Community Forums › Forums › Archived Forums › Design Tips and Tricks › Custom Body Class Lifestyle Pro
- This topic has 5 replies, 2 voices, and was last updated 9 years, 2 months ago by
jaqkar.
-
AuthorPosts
-
February 18, 2016 at 5:20 am #179298
jaqkar
ParticipantHi
Trying to use the custom body and post classes on a page in Lifestyle Pro. Do I need to add this to my functions.php or not since the child theme has this built in? http://my.studiopress.com/snippets/custom-body-class/
I added a custom body style on the page and then defined it in my css and tested it but it does not work. This is my css for testing:
.custom-class {
http://www.bodyangelica.co.za/treatments/
border: solid red 100px;
font-family: 'georgia', arial;
color: #80000;
}February 18, 2016 at 8:12 am #179306Victor Font
ModeratorThat code snippet with work if you want to replace the current body class in Lifestyle Pro. If you want to add an additional class to the current classes, this is one way to do it:
add_filter( 'body_class', 'my_body_class' ); function my_body_class( $classes ) { array_push($classes, 'custom-class'); return $classes; }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 18, 2016 at 8:34 am #179307jaqkar
ParticipantThanks Victor! Now not so sure I am on the right track. I wanted to test with body but now I want to try the post class, trying to target a class on a current page and overriding it with my post class. This is the page: http://www.bodyangelica.co.za/treatments/
I am trying to hide the Price which is class: mp_product_price-normal
What I thought I would try is to specify a custom post class and change it using something like:
.my_custom_class . mp_product_price-normal { display: none !important; }
Am I on the right track here?
February 18, 2016 at 9:07 am #179308jaqkar
ParticipantSo I figured out that Marketpress once run with a shortcode on a normal page now suddenly controls the css for that content section through a child stylesheet it uses. Huh?
When I added the above css to that it worked. Not sure I am loving that it is doing that!
February 18, 2016 at 10:50 am #179318Victor Font
ModeratorMaybe this can help, but I'm not so sure: http://victorfont.com/genesis-framework-add-a-custom-css-class-to-elements/
It's not a good idea to add custom classes to plugins because when the plugin gets updated, your customizations will be overwritten. A better idea is to load your child theme's style sheet after the plugin style sheet, in which case this should help: http://victorfont.com/change-genesis-child-theme-style-sheet-load-order/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 19, 2016 at 5:48 am #179381jaqkar
ParticipantThanks Victor, will be reading through your post. Will also have a browse and learn, like your site. I managed to create a custom style outside the plugin for Marketpress and now using that. I would rather prefer to be using my own Genesis Theme/Child but it is like Marketpress is controlling the post section and to edit Marketpress page template it has issues with Genesis. I am lost with the Genesis and Marketpress not playing nice because to create a new page template for Marketpress using Genesis loop is where I am not sure what to do.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.