2016-11-11, 05:53:15
(2016-11-10, 08:06:50)Riianna Wrote: How about showing single tag of current news with post count, not the whole tag list.
Since NM 3.1 you can use
<?php nm_single_tag_title(); ?>
to display the current tag if on a tag page.To display the post count for the current tag, add this to your theme's functions.php file (create it if it doesn't exist):
PHP Code:
if (!defined('nm_single_tag_count')) {
function nm_single_tag_count() {
$tag = nm_single_tag_title('', '', false);
if ($tag) {
$tags = nm_get_tags();
echo count($tags[$tag]);
}
}
}
and then you can display the number with:
Code:
<?php nm_single_tag_count(); ?>
For example, you can do this in your template:
PHP Code:
<?php if (nm_is_tag()) { ?>
<?php nm_single_tag_title(); ?>: <?php nm_single_tag_count(); ?> post(s)
<?php } ?>
I may add that function to the plugin...