Add body_class to page templates in wordpress

Go to source

snippet :  PHPcopy
	function add_archive_classes_to_page_templates($classes) {
		if (is_page_template('news.php')) {
			$classes[] = 'news';
		}
			return $classes;
	}
	add_filter('body_class', 'add_archive_classes_to_page_templates');

source →


Add body_class to page templates in wordpress is a post from: wpsnipp.comWordPress Snippets, Code, Hacks, 590+ for your theme, blog
which is not allowed to be copied on other sites.”

Share this post.


Add body_class to page templates in wordpress“>Facebook | Add body_class to page templates in wordpress“>StumbleUpon | Add body_class to page templates in wordpress“>Delicious | Add body_class to page templates in wordpress @wpsnipp”>Tweet It | Add body_class to page templates in wordpress“>Digg This

© wpsnipp.com All Rights reserved.

source: wpsnipp.com