WordPress.org

Ready to get started?Download WordPress

Forums

Better Tag Cloud
Limit to specific taxonomy AND post type (7 posts)

  1. betadog
    Member
    Posted 2 years ago #

    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/

  2. betadog
    Member
    Posted 2 years ago #

    No? I think this would be really useful...

  3. betadog
    Member
    Posted 2 years ago #

    Too bad

  4. sunriseweb
    Member
    Posted 2 years 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]

  5. nosoup
    Member
    Posted 2 years ago #

    I am looking for this as well - the code from the previous post has been removed.

  6. betadog
    Member
    Posted 2 years ago #

    @sunriseweb: Could you please repost on Pastebin?

  7. nosoup
    Member
    Posted 2 years 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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic