Add Slug
-
Hi Everyone,
I was hoping somebody could help me. I think your plugin is fantastic, we have deployed on our new site however we use <body> classes to switch the background colour depending on which section you are in.
We are looking to add a body class to the job listing page. I have created a single-job_listing.php in my theme folder but I cannot add the body class there.
Does anybody know how I can add this code:
<?php add_filter('body_class','job_listing');?>
To either the single-job_listing,php or more likely the functions.php file of my theme but ONLY for the job listings?
I have tried to add the following to my functions.php file but it did not work:
add_filter( 'body_class', 'sp_body_class' ); function sp_body_class( $classes ) { if ( is_page( 'single-job_listing' ) ) $classes[] = 'job_listing'; return $classes; }
Any help would be appreciated.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Add Slug’ is closed to new replies.