• Resolved gpetez

    (@gpetez)


    This seemed really easy but I’m struggling. I’ve looked over much of the documentation and can’t get anything to work.

    All I need to do is echo the number of tags that a given post has attached to it.

    For example, if we are on a post named “cool photos”

    I would want to echo the number of tags like:

    Cool Photos Tagged with “14” tags.

    No links, just printing plain text.

    Any solutions or ideas?

    Thanks for your consideration.

Viewing 2 replies - 1 through 2 (of 2 total)
  • J M

    (@hiphopinenglish)

    Using get_the_tags you should be able to do this:

    $posttags = get_the_tags();
    echo 'Cool photo tagged with '. count($posttags) . ' tags';

    You can see more about get_the_tags in the Codex.

    Thread Starter gpetez

    (@gpetez)

    Thanks man. Perfect.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Number of Tags attached to Post’ is closed to new replies.