Skip to content

Instantly share code, notes, and snippets.

@asufian97
Created January 3, 2018 02:54
Show Gist options
  • Select an option

  • Save asufian97/f06ad4b3d37bed4e86584da9bc8125ed to your computer and use it in GitHub Desktop.

Select an option

Save asufian97/f06ad4b3d37bed4e86584da9bc8125ed to your computer and use it in GitHub Desktop.
register taxonomy
add_action('init', 'wpshout_register_taxonomy');
function wpshout_register_taxonomy() {
$args = array(
'hierarchical' => true,
'label' => 'Awesome Taxonomy',
);
register_taxonomy( 'awesome_taxonomy', array( 'post', 'slider', 'awesome' ), $args );
$args = array(
'hierarchical' => false,
'label' => 'Awesome Taxonomy',
);
register_taxonomy( 'awesome_taxonomyq', array( 'post', 'slider', 'awesome' ), $args );
}
//display taxonomy
?>
<?php the_terms( $post->ID, 'topics', 'Topics: ', ', ', ' ' ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment