Skip to content

Instantly share code, notes, and snippets.

@yellowberri-snippets
Last active December 22, 2015 01:08
Show Gist options
  • Save yellowberri-snippets/6393859 to your computer and use it in GitHub Desktop.
Save yellowberri-snippets/6393859 to your computer and use it in GitHub Desktop.
PHP: WP: Get All Terms in Taxonomy (even if not in post)
$taxonomy = 'services';
$terms_args = array (
'hide_empty' => false,
'orderby' => 'name',
'order' => 'ASC'
);
$terms = get_terms( $taxonomy, $terms_args);
foreach ( $terms as $term ) {
echo $term->name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment