WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a blog plugin. I have the blog category in my blog. I would like to get the list of all the blog categories and list it in my www.domain.com/blogs/ page. My blog category name is 'blogcategory' . I do not know how to use it in the list-category function.

I am a nooby to wordpress development.

share|improve this question
up vote 2 down vote accepted

Can I use the following code for my question.

<?php $args = array('taxonomy' => 'blogcategory'); ?>
<?php $tax_menu_items = get_categories( $args );
foreach ( $tax_menu_items as $tax_menu_item ):?>

    <a href="<?php echo get_term_link($tax_menu_item,$tax_menu_item->taxonomy); ?>">
        <?php echo $tax_menu_item->name; ?>

<?php endforeach; ?>

I found it from here

Updated: I found the answer I was looking for


$taxonomy = 'blogcategory';
$tax_terms = get_terms($taxonomy);
foreach ($tax_terms as $tax_term) {
echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.