Support » Themes and Templates » Retrieve base url for tags

  • Resolved EOZYVS

    (@eozyo)


    Hi, I have been checking the codex and I don’t seem to find a way to retrieve the tag base url.

    For example to access a tag i go to:

    http://mysite.com/tag/tagname/

    Where tag is your chosen prefix, defined in Admin -> Settings -> Permalinks

    I’ve tried with $wp_rewrite but it’s not there, any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The tag and category base are stored in wp_options. You can use get_option( 'tag_base' ) to retrieve it.

    Thread Starter EOZYVS

    (@eozyo)

    Thank you very much NateJacobs, that was precisely what i was looking for.

    I would like just to point out that something must be set as tag base in your Admin -> Settings -> Permalinks area, if you leave it empty get_options('tag_base') returns empty as well.

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Retrieve base url for tags’ is closed to new replies.