Page not found for Wordpress Post type Category

Asked

Viewed 319 times

1

I’m learning to create a theme in Wordpress and created a Post Type custom. Inside the page I listed the categories created only for this Post Type specific. I just don’t know how to create a file that behaves like the Category.php only for those specific categories of Post Type servant.

I do not know if I was clear, but help me pls.

1 answer

0


The wordpress documentation provides an about hierarchy of theme files that can help you, but I believe that the file you want to create will be called taxonomy-SLUG_DA_TAXONOMIA.php.

Below is an image that summarizes well which files are used and in which order (in the absence of one it tries the next one, always stopping at index.php).

Hierarquia dos arquivos de tema WP

  • Yeah, I created the file that way, but it still goes to 404. Maybe I was wrong in functions.php or permanter link configuration functions.php: register_taxonomy('produto_category','produto', $args);

  • If it goes to 404 the problem is not the same file, it is the address or how you created the taxonomy. If in $args you’re not putting query_vars as false or by changing the value of rewrite the category should be accessible by /produto_category/SLUG or so with some prefix if you set us like this Links Permanentes.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.