Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter chasperlisimba

    (@chasperlisimba)

    I saw that there is the the_item_post_count function available now. How can I use it in a shortcode?

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    you have good eyes. Yes, the newly released version 2.2.0 includes the ability to show the post-count for taxonomy terms. To use this new functionality you need to customise the template that the plugin uses. First, copy the file at wp-content/plugins/a-z-listing/templates/a-z-listing.php into your theme’s directory alongside functions.php. It should be named a-z-listing.php.

    Once you have your own template in your theme you can customise it. To add the post-count on a taxonomy term you can edit the file and find on line 58 the code <?php $a_z_query->the_title(); ?>. Add to that the the_item_post_count() call so that the line now looks like:

    <?php $a_z_query->the_title(); ?> (<?php $a_z_query->the_item_post_count(); ?>)
    

    Note that this will affect all listings whether or not they show taxonomy-terms. i.e. if they show posts the listing will have (0) after every post title. I’ll make a note to add an extra method to allow the template to know what type of item it is displaying (term or post) because at the moment it is not easy to figure that out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘count of used terms’ is closed to new replies.