I have to display a button that links to a tag, but I have to hide the button if tag doesn’t exists to avoid broken links.
How can I check if a specific tag exists inside wp database?
This is what I have so far:
$tag_path="/tag/testing/";
if( !$page = get_page_by_path( $tag_path ) ){
//hide button link
} else {
//show button link
}