php - How to display selected category term in Wordpress? -


i want able display selected category term custom post type. so, example parent category "industry". sub-categories "restaurants, web design, etc.". category selected "web design". need display "web design" on front end of website "industry - web design".

you'd want try this:

<div class="yourelement">     <p>industry - <?php the_terms( $post->id, 'industry');?> </p> </div> 

i guessed slug industry industry, you'll want double check that.

the terms codex goes more detail on how functions , shows more options: https://codex.wordpress.org/function_reference/the_terms


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -