Created
April 17, 2018 10:22
-
-
Save DonKoko/67a13d0ec33afa480e7fa73cb5a10fe0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Shortcode for showing job categories | |
function dm_display_wpjm_categories () { | |
$terms = get_terms( array('taxonomy' => 'job_listing_category', | |
'hide_empty' => false,)); | |
// begin output buffering | |
ob_start(); | |
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ | |
echo '<ul class="job-categories-wrapper">'; | |
foreach ( $terms as $term ) { | |
echo '<li>' . '<a class="avia-button avia-color-theme-color avia-size-label" href="' . esc_url( get_term_link( $term ) ) . '">' . $term->name . '</a></li>'; | |
} | |
echo '</ul>'; | |
} | |
// end output buffering, grab the buffer contents, and empty the buffer | |
return ob_get_clean(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment