When creating a website on WordPress, it can be really useful to be able to add one (or more) custom parameter into the body_class() function. Here is a function I use very often when building sites for my clients.
Copy and paste this code in your themes function.php files
function custom_body_class($classes){
if(is_singular()){
$myvar = "myparam";
} else {
$myvar = "anotherparam";
}
global $post;
array_push($classes, $myvar);
return $classes;
}
add_filter('body_class', 'custom_body_class');
Save file.
Enjoy Code!
I really like what you guys are usually up too. This type of clever work
and coverage! Keep up the superb works guys
I’ve added you guys to our blogroll.
This paragraph will assist the internet people for
building up new weblog or even a blog from start to
end.
Hey There. I discovered your weblog using msn. That is a really
neatly written article. I will be sure to bookmark it and come back to read extra of your useful info.
Thank you for the post. I will definitely return.
Your most welcome :)
I like to disseminate understanding that I have built up through the yr to help improve team
performance.
Thanks for comment!
I like to share knowledge that will I’ve accumulated through the yr to assist improve group efficiency.
Thanks for comment!
Tremendous things here. I’m very happy to see your article.
Thank you a lot and I’m looking forward to touch you.
Will you please drop me a e-mail?
Yes Sure!, I have just sent a email on your email id sherman_XXXXX@gmail.com, please check any reply me. you can also contact me directely on my email raghunath.0087@gmail.com.
This is a topic which is close to my heart… Thank you! Exactly
where are your contact details though?
I do agree with all of the concepts you’ve introduced in your post.
They are very convincing and can certainly work. Nonetheless, the posts
are too brief for newbies. May you please lengthen them a little from next time?
Thanks for the post.