admin管理员组

文章数量:1389758

This question already exists: Genesis custom post type pagination leads to 404 [closed] Closed 5 years ago.

I have the below filter in my register method that will pull in a specific template file based on a custom taxonomy:

add_filter('taxonomy_template', function($template) {
    if (is_tax( 'recipe-categories')) {
        $template = ABSPATH . 'wp-content/mu-plugins/sacfoodies/templates/recipe-taxonomy-single.php';
    }

    return $template;
});

It pull in all the recipe-categories slugs and displays the proper template as shown below:

/recipe-categories/bread/
/recipe-categories/breakfast/

But, I'm attempting to add pagination to the custom taxonomy template and I'm getting a 404 error, so if the URL is /recipe-categories/bread/page/2, the template is not detected anymore.

本文标签: pluginstaxonomytemplate filter not working on pagination