Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save clare485/6376517 to your computer and use it in GitHub Desktop.
Save clare485/6376517 to your computer and use it in GitHub Desktop.
custom taxonomy - if is in custom category show this 'float-components' is the slug of the product category, 'products' is the name of the taxonomy - which in this case was added in the functions.php
<?php if (has_term('float-components', 'products')) { ?>
put content here
<?php } ?>
/*
* custom taxonomies - add this to functions.php
*/
function build_taxonomies() {
register_taxonomy(
'products', 'product', array(
'hierarchical' => true,
'label' => 'product category',
'query_var' => true,
'rewrite' => true
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment