EOZYVS
Member
Posted 7 months ago #
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?
The tag and category base are stored in wp_options. You can use get_option( 'tag_base' ) to retrieve it.
EOZYVS
Member
Posted 6 months ago #
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,