简体   繁体   中英

Tag.php not being recognized

I'm trying to style my /post_tag/tag/ pages. For some reason, my tag.php just is not being recognized. It keeps defaulting to my index.php . I can't figure out what I'm doing wrong. I've posted my test code below.

I've already tried various file names involving tag-id and tag-slug .

<?php
/**
 * The template for displaying Tag pages
 *
 * Used to display archive-type pages for posts in a tag.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 */
get_header(); ?>
helo
<?php get_footer();?>

Would like to see the above page when I go to site/post_tag/tag , but instead I see my index.

I don't use tags very often but just did a quick check on my local install and for me tag.php is accessible through

www.site.com/tag/tag-name

If I use the url you suggested I get index.php but it's actually a 404 page(I can see in the page title) I just don't have a 404.php created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM