WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Tag Count, example Tag (13) (5 posts)

  1. shaneholden
    Member
    Posted 4 years ago #

    Either I'm overlooking it, or it's not possible yet in 2.8.4.

    How do you get the tags for a post on single.php, and have it show the count of the posts that are tagged with that tag. Matt's blog has this, so I wasn't sure if it's a 2.9 feature or what.

    ex. Tag A (2), Tag B (13)

    Thanks!

  2. MichaelH
    Member
    Posted 4 years ago #

    I believe this example from t31os_ http://wordpress.org/support/topic/329557?replies=5#post-1274410 should work but change

    $cats = get_terms('category', $args);

    to

    $cats = get_terms('post_tag', $args);

    and

    get_category_link( $category->term_id )

    to

    get_term_link($category, 'post_tag')

    [edit]

  3. shaneholden
    Member
    Posted 4 years ago #

    Thanks for the reply!

    That almost does it, but it lists all the tags for my site. There must be a way to limit it to the post being viewed.

    I appreciate the help and will keep poking at it and maybe get it working :)

  4. MichaelH
    Member
    Posted 4 years ago #

    Oh sorry...missed that...try

    $cats = get_the_tags();

    instead of

    $cats = get_terms('post_tag', $args);

  5. shaneholden
    Member
    Posted 4 years ago #

    Thanks Michael, you're the man!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags