I would like to know if it possible to show the tag count next to the tag. If so, how do you do it?
Something like:
Apples (20)
Oranges (5)
Bananas (16)
https://www.ads-software.com/plugins/wordpress-media-tags/
]]>I am customizing P2 as a child theme for my own private internal chatroom, and there are 2 things I want to do:
1. Remove the tag count between brackets on the posts.
2. Remove the “Permalink” action link (next to “Reply | Edit”) on posts and comments, which I find pretty useless.
For #1, I normally just go inside the functions.php get_tags_with_count and replace:
$tag_link = '<a href="' . get_tag_link( $tag ) . '" rel="tag">' . $tag->name . ' ( ' . number_format_i18n( $tag->count ) . ' )</a>';
by
$tag_link = '<a href="' . get_tag_link( $tag ) . '" rel="tag">' . $tag->name . '</a>';
Is there a better/cleaner way to do that without having to make that change every time P2 gets updated?
For #2, the problem seems more complicated… I’ve done some Googling and it seems I may have to not only edit functions.php but also some other files. My first attempt seems to have made a mess as when I use the Search box on my site it now displays the search result in complete random order (as opposed to chronological).
Any help and suggestions appreciated!
Thanks in advance,
Mathias
https://www.ads-software.com/themes/p2/
]]>I’d like to take the number of posts associated with a tag, and plot them on a chart to show the tag distribution.
I’ve figured out how to get the count of a specific tag. How would I plot this on a doughnut chart?
<?php
$taxonomy = "post_tag";
$term_name = 'iPhone';
$term = get_term_by('name', $term_name, $taxonomy);
echo $term->count;
?>
https://www.ads-software.com/plugins/wp-charts/
]]>I’m thinking of removing the mouseover message that shows the count because it makes it look like images are missing.
https://www.ads-software.com/plugins/nextgen-gallery/
]]>For Example you click on tag ‘WORK’
Text to be displayed on starting:
30 posts have been added under tag ‘WORK’
same for ever TAG
I am using ‘twenty ten theme’
Thanks in advance
]]>when i see https://XXXXXX.XXX/?tag=a , i want to see MyPost_2 before MyPost_1
how?
]]>I was wondering if anyone had a nice clean & simple way of outputting the total amount of tags used on a wordpress site as just a plain number.
Each time I add a new post I use a tag to place it into a film genre (eg Horror etc). I want to have something like:
Movies: 234
Genres: 142
I have found a way to count and output a number of the amount of posts within the ‘Movie’ category
<?php echo wp_count_posts()->publish; ?>
So I am looking for something as simple to display the number of tags used. I am really surprised I am having as much trouble finding a solution as I am as this (to me) seems like a pretty basic and useful thing to add to the Codex.
Any ideas would be awesome. Thanks guys
I’ve tried a few things:
$args= array('tag__in' => array('1', '3', '5'));
$alltags = get_terms('post_tag', $args);
That just locks the page up.
I’ve tried this as well:
$args = array(
'slug'=>array('slug1', 'slug2', 'slug3'));
$alltags = get_terms('post_tag', $args);
And I’ve tried different variations of each.
Any thoughts on how to pull the post count on a set of tags? I could do multiple get_terms with each slug but I’m trying to have 1 database pull and not 10. Thanks!
]]>