最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - taxonomy_template filter not working on pagination

programmeradmin0浏览0评论
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.

发布评论

评论列表(0)

  1. 暂无评论