I’m searching for half an hour now on how to get the url/permalink base in WordPress (the ‘category’ and ‘tag’ value set in the backend). Could you please point me in the right direction?
I want to dynamically print the following – but only replace the
category part (not the tag/category itself):
<a href="/tags/my-tag">My Tag</a> <a href="/category/my-category">My Category</a>
You really shouldn’t need this, as you should be outputting the URLs via the API:
However, for the sake of answering the question, they’re stored in options:
get_option( 'tag_base' ); get_option( 'category_base' );