WordPress.org

Ready to get started?Download WordPress

Forums

Retrieve posts by a tag in the url (6 posts)

  1. valuxes
    Member
    Posted 4 years ago #

    Can I retrieve posts for a particular tag (e.g. "a tag")by simply using the tag slug in the URL (e.g. http://abc.com)?

    e.g. http://abc.com/tag/a%20tag

    I tried but it does not seem to work...

  2. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    If you are trying to display the posts on your blog with a specific tag then it should not be an issue, for example, I can type into the address bar this URL for my home site: http://buynowshop.com/tag/cais and press enter. It will display all the posts with the 'cais' tag. (The site default theme does not use a tag.php template, currently.)

    If you are trying to do something else, perhaps you could provide some more details. Also, your blog URL may be helpful as well.

  3. Mark / t31os
    Moderator
    Posted 4 years ago #

    The url would actually be..

    yoursite.com?tag=tagname

    ..unless you have permalinks enabled, in which case you'd get the pretty URL like cais has shown above..

  4. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    @t31os_ - Good catch ... I was using my main site to check the format, where "pretty" URLs are enabled.

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    Alot of users have pretty permalinks on, but thought i should point it as that may be the source of valuxes problem.

  6. valuxes
    Member
    Posted 4 years ago #

    Thanks for all the responses. cais' solution works. My mistake is the space between the words: I was typing the Name (a tag) instead of the slug (a-tag). Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic