404 if Tag does not exist
-
2 questions:
1. If a searched tag does not exist, does it even step into tag.php file?
Eg: example.com/tag/ddddddddddddddddddddddddddd/ where the d’s dont exist.2. if tag.php does get executed, can somebody tell me why is it hitting a 404 for me (for invalid tag, otherwise works fine)?
please and thanks in advance.
code:
if ( is_tag() && !is_home() ) { $tagterm = single_tag_title( '', false ); if ( term_exists( $tagterm ) ) { if ( have_posts() ) : echo "<h2>Keyword Results for ".$tagterm."</h2>"; else : echo "<h2>No Entries Found for Keyword ".get_search_query()."</h2>"; endif; } else { echo "<h2>No Keyword Match Found for ".get_search_query()."</h2>"; wp_tag_cloud( 'taxonomy' => 'post_tag' ); } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘404 if Tag does not exist’ is closed to new replies.