Bug: Block-Pagination does not work with custom post type

Posted in: Newspaper
Post count: 209

Hello!
I use Block 18 to display episodes from the custom post type “podcast”. I set the filter of the blog to “podcast” and the latest episode is shown. But the pagination “Load more button” does not work correctly. When I click on it, it always shows the same first episode again and again and not the previous one.

Post count: 20685

Hi,

That is not supposed to happen, try to use the same pagination in the same or a different block, in a new page. Make a test and see what happens.

Also do you maybe use the unique articles setting for that page?
https://forum.tagdiv.com/unique-articles/

Post count: 209

Hi Simion,
I changed some settings. Here are the results:

1. Changing to unique articles => error still there, same post appears again and again
2. Changing from “Load more …” to “Next Prev Ajax” => error still there
3. Set an offset of 1 => it works! Previous post do appear.
4. Trying different blogs with same custom post type => error appears there, too

So it seems to be a bug with custom post type. The offset is no solution, because the page doesn’t show the newest post of that custom post type.

And now comes my the tricky workaround for that bug 🙂

I set the offset to 0.5 – and this works! Newest post is shown and clicking the “Show more” button brings the previous posts.

But this workaround can’t be the solution, I think 😉

Post count: 20685

Now that is unusual, I only tested with the default custom post type added by this example plugin
https://forum.tagdiv.com/custom-post-type-support/
For me the posts are ordered as chosen, also the pagination seems to work. Does it work with default posts and categories?

I thought that maybe you activated the unique articles setting, that does not work with pagination and would result in duplicates when using it.

Post count: 209

It works with no problems for normal posts.
The post-type podcast is inserted by the Podlove-Podcast-Plugin:
https://de.wordpress.org/plugins/podlove-podcasting-plugin-for-wordpress/

Other things like filters work with no problem for type podcast.

Post count: 20685

I made a quick test with that plugin, it added the episodes post type. I added a few episodes
https://www.screencast.com/t/u6XYZpP2f
I then configured a block to show the podcast post type, using the load more pagination as well
https://www.screencast.com/t/exLyqAfVnYFg

The posts are not repeating for me
https://www.screencast.com/t/ReT9htv8fo
https://www.screencast.com/t/lpSvjXDqq
https://www.screencast.com/t/ska4HbH4g

Maybe the problem is elsewhere in your case, you could try to deactivate all other plugins, except theme plugins and the plugin. If you use a child theme that contains code or theme modifications, deactivate it. Temporarily remove custom code or functions added in the theme files directly.

I used the latest version of the theme in my test.

Post count: 209

Hello Simion,
thank you for your test! I compared your filter-settings which are absolutely identical with mine.

But maybe I found the reason: Whats in the field “Offset posts” in your “General” tab? I assume it’s empty. Now enter 0 instead, save the page and see, what’s happening.

Post count: 20685

Hi,

I tried that in the CPT block and also in a normal block, the posts are duplicated with an offset of 0
https://www.screencast.com/t/0K5YhuIA5An
I never tried setting an offset of 0 before. Without this offset it works for me.

Post count: 209

Glad you could also reproduce the error.
Yes, without the 0 it works for me, too.
To enter 0 might be normal if you first entered an offset of 1 or 2 and if you don’t want it anymore, it might be normal to set it to 0 instead of emptying the field.

Post count: 20685

You don’t have to enter 0, if you don’t want an offset leave the field empty. Entering 0 caused the problem.

Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic.