display custom posts without slug and pagination problem
-
Hi I am having some issues with pagination when I have removed the slug from my custom-post type – I found this tutorial:
https://vip.wordpress.com/documentation/remove-the-slug-from-your-custom-post-type-permalinks/
– it works well but when it came to pagination the page seems to get sent to the 404 page when I try to go to : https://www.example.com/my-news/page/2
I do not believe there are any collisions with pages or other entities using the same name as the custom-post type. As you can see I am also using the permalink structure of: https://www.example.com/%postname%/
To get the pagination to stay in the url bar without redirecting I also followed the instructions here:
https://wordpress.stackexchange.com/questions/134339/pagination-on-custom-post-type-not-working-if-permalinks-set-to-rewrite-url which puts the following code into functions.php:
function custom_disable_redirect_canonical( $redirect_url ){ if ( is_singular('advanced_page') ) $redirect_url = false; return $redirect_url; } add_filter( 'redirect_canonical','custom_disable_redirect_canonical');
Any advice on how to fix the pagination problem would be most appreciated. Thanks.
- The topic ‘display custom posts without slug and pagination problem’ is closed to new replies.