Created
August 23, 2017 04:49
-
-
Save turtlepod/d273acc17e582a12ccd4e69d1b9c4a0a to your computer and use it in GitHub Desktop.
Listify: Display All Category (not nested) in single listing page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Remove Category: | |
remove_action( 'single_job_listing_meta_start', 'listify_the_listing_category', 30 ); | |
// Use Custom Category: | |
add_action( 'single_job_listing_meta_start', function() { | |
$cats = get_the_term_list( | |
get_post()->ID, | |
'job_listing_category', | |
'<span>', | |
', ', | |
'</span>' | |
); | |
?> | |
<div class="content-single-job_listing-title-category"> | |
<?php if ( $cats && ! is_wp_error( $cats ) ) : ?> | |
<?php echo $cats; // WPCS: XSS ok. ?> | |
<?php endif; ?> | |
</div> | |
<?php | |
}, 30 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment