I love the plugin, great job.
I'd like to have a widget (or short code or template code) that displays a tag cloud for a certain taxonomy but ONLY count posts from a certain custom post type.
Example: I have a custom post type "books" and one called "movies". In the sidebar next to a single book I want to list genres (like "drama" and "comedy") in a tag cloud but only for books not for movies.
Is this possible?
http://wordpress.org/extend/plugins/nktagcloud/
No? I think this would be really useful...
sunriseweb
Member
Posted 11 months ago #
I need the exact same thing (although I'm not using the Better Tag Cloud plugin or displaying counts) and so created my own version of the core /wp-includes/category-template.php wp_tag_cloud function that seems to do the trick - see below - (although I'm sure I'm missing the boat on some things like re-write rules when I look at the /wp-includes/taxonomy.php get_term_link function).
You call the new function something like:
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
nosoup
Member
Posted 10 months ago #
I am looking for this as well - the code from the previous post has been removed.
betadog
Member
Posted 10 months ago #
@sunriseweb: Could you please repost on Pastebin?
nosoup
Member
Posted 10 months ago #
Ok - I kept looking and found something that worked for me.
This post gave me most of the info, although there is a typo in the syntax:
http://wordpress.stackexchange.com/questions/33455/taxonomy-count-per-post-type
I put the modified code here: http://pastebin.com/7UPYq2DQ