-
Notifications
You must be signed in to change notification settings - Fork 37
Post List Doesn't Update in Sync with Pagination #124
Comments
@ahmadawais so the issue is that the list of post sections in the Customize pane appear in a different order than the posts appear in the preview? Part of the issue I think is that the post settings are exported from the preview in an object (mapping ID to setting properties) as opposed to an array of settings: wp-customize-posts/js/customize-posts.js Lines 59 to 76 in 9ccc8f2
Objects in JavaScript are not ordered, so this could be part of the issue. Another issue could be that the posts sections get added the to bottom of the list as they are encountered (e.g. infinite scroll or updating a Recent Posts widget to show more posts): wp-customize-posts/js/customize-post-section.js Lines 68 to 74 in 9ccc8f2
In regards to Sticky posts: it is also somewhat expected that these wouldn't be exported in the order displayed because the posts get re-ordered in wp-customize-posts/php/class-wp-customize-posts-preview.php Lines 127 to 147 in 9ccc8f2
|
I guess, it is not just limited to the order of posts. E.g. The first post being displayed in the image above i.e. I can test it more and try to figure out a pattern. |
I think the pattern will end up being random at times due to the JS object not preserving the order. |
^You are right. |
So, I went ahead installed the plugin from the W.org repo via WPCLI. The first test was to see if the list of pagination updates in sync with the list of pagination being displayed in the theme.
Somehow, this doesn't work well. Sometimes the sticky post sticks at the top, other times it doesn't. Check this image; there are 5 posts above the posts list being displayed in the theme, those five posts are not sticky.
The text was updated successfully, but these errors were encountered: