admin管理员组文章数量:1290927
The pagination links in CPT archive created with Elementor Pro get a 404.
I've spend a full day searching and trying everything I found on Google with search "CPT Elementor archive pagination 404": readjust posts per page in write settings, tweak Function.php, tweak cpt php (in my case as a custom made plugin , see herafter) and some other... none resulting in a partial or full solution.
Example of page resulting in 404 is here: / (access with admin/admin). The standard archive pagination links work perfectly (/). This is test site, same happens on proper website.
This is driving me crazy. I'm doing my best with the beginner knowledge I have. Please help.
add_action('init', 'CT_temoignage');
function CT_temoignage()
{
register_post_type('post-temoignage', array(
'label' => __('Témoignages'),
'singular_label' => __('Témoignage'),
'public' => true,
'has_archive' => true,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'taxonomies'=> array ('category', 'post_tag'),
'supports' => array('title', 'author', 'editor', 'thumbnail','excerpt','revisions','page-attributes','publicize', 'wpcom-markdown'),
'menu_position'=>5,
'rewrite' => array('slug' => 'temoignages','with_front' => true),
// 'query_var' => 'temoignage'
'publicly_queryable' => true,
'query_var' => true,
'rewrite' => false,
));
add_theme_support( 'post-thumbnails' );
global $wp_rewrite;
$gallery_structure = '/temoignages/%post-temoignage%';
$wp_rewrite->add_rewrite_tag("%post-temoignage%", '([^/]+)', "post-temoignage=");
$wp_rewrite->add_permastruct('post-temoignage', $gallery_structure, true);
}
// Add filter to plugin init function
add_filter('post_type_link', 'post_temoignage_permalink', 10, 3);
?>```
本文标签: custom post typesHelp with Elementor Pagination CPT archive 404 problem
版权声明:本文标题:custom post types - Help with Elementor Pagination CPT archive 404 problem 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741521766a2383229.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论