Home Forums WoodMart support forum Load More Posts button malfunctioning

Load More Posts button malfunctioning

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #568888

    josh-6874
    Participant

    I placed “Load more posts” button on the main page but it fails to load older posts properly.
    It displays duplicated blog posts and forever remains at loading status.
    Please refer to the screenshot video for details.

    • This topic was modified 6 months, 2 weeks ago by josh-6874.
    Attachments:
    You must be logged in to view attached files.
    #568890

    josh-6874
    Participant

    URL to the issue

    • This reply was modified 6 months, 2 weeks ago by josh-6874.
    #569213

    Hung Pham
    Keymaster

    Hi josh-6874,

    Thanks for reaching to us.

    First of all, I’m really sorry have taken long time to reply you.

    You should deactivate all plugins (except Required Plugins) and then reactivate them one by one. This makes it very easy to isolate the plugin causing problems.

    Regards,

    #569282

    josh-6874
    Participant

    I disabled all plugins but Woodmart Core and WPBakery Page Builder but the problem persists. Same symptom.
    I configured the blog element to display 3 items in 3 columns but after adding a new blog post I am seeing 4 blog posts at once, the first one being a sticky post.

    #569417

    Hung Pham
    Keymaster

    Hi josh-6874,

    To assist you in the best possible manner, I kindly ask that you please provide me temporary wp-admin info (wp-admin URL, username, password) to the Private Content area, this will allow me to thoroughly investigate and address your concerns more efficiently.

    Regards,

    #569594

    josh-6874
    Participant

    Please refer to the private section for login details.

    #569610

    Hung Pham
    Keymaster

    Hi josh-6874,

    Thanks for details.

    There are many errors in Console log related to JS issue https://prnt.sc/NleqO2-wplO8

    You should deactivate all plugins (except Required Plugins) and then reactivate them one by one. This makes it very easy to isolate the plugin causing problems.

    Regards,

    #569620

    josh-6874
    Participant

    I reinstalled WordPress, Woodmart theme and overwrote js files to counteract the JS issues you have addressed.
    Then I disabled all plugins but Woodmart Core and WPBakery Page Builder but the problem persists.
    The JS issues arise only when “Load more posts” JS is triggered.

    #569687

    josh-6874
    Participant

    By editing the page and saving it again solved the issue. (I really have no idea what is going on here.)
    The remaining issue is that the “number of items per post” under WPBakery does not consider the sticky blog post, and displays in addition to it. For example, if I make one blog post sticky and the the number of items per post to “3”, 4 blog posts appear instead of three. Can you help me fix this?

    #569716

    Hung Pham
    Keymaster

    Hi josh-6874,

    Would you mind if I deactivate extra plugins for testing? Please confirm me back.

    Regards,

    #570079

    josh-6874
    Participant

    Yes. It’s a development site. You may perform any tasks related to fixing the issue.

    #570085

    Hung Pham
    Keymaster

    Hi josh-6874,

    You can put offset value to make it works properly. https://prnt.sc/8j7rc14l1Ghp

    You should reactivate plugins one by one. This makes it very easy to isolate the plugin causing problems.

    Regards,

    #570086

    josh-6874
    Participant

    Configuring Offset displays according to the “number of items per post” but offsetting (to “1” in this case) “hides” the latest blog post. The theme needs to consider the number of sticky blog posts when displaying the total number of blog posts configured by the page. The theme needs a fix, in my opinion.

    #570380

    Hung Pham
    Keymaster

    Hi josh-6874,

    I’ve passed this topic to one of our developers, and I will let you know once get an answer.

    Regards,

    #570510

    Hung Pham
    Keymaster

    Hi josh-6874,

    Please send:

    – FTP info (server, username, password, port)

    I will need to enable debug log to find root cause of issue.

    Regards,

    #571619

    josh-6874
    Participant

    I installed a plugin called “File Manager” which allows full access to WP files.
    Please login and access the URL in the private section.

    • This reply was modified 6 months ago by josh-6874.
    #571765

    Hung Pham
    Keymaster

    Hi josh-6874,

    Please try to add the code below in the functions.php file in your child theme, let me know if it works correctly.

    add_filter('pre_get_posts', function ( $wp_query ) {
    	if ( is_admin() || $wp_query->is_main_query() || 'post' !== $wp_query->get('post_type') ) {
    		return $wp_query;
    	}
    
    	$wp_query->set( 'ignore_sticky_posts', true );
    
    	return $wp_query;
    });

    Regards,

    #571849

    josh-6874
    Participant

    I added the code but there is no difference in how blog posts are displayed. It still displays four blog posts instead of three. The total number of posts need to include the number of sticky posts but it doesn’t.

    #571987

    Hung Pham
    Keymaster

    Hi josh-6874,

    This code actually works. In our theme, in order to display posts, we use the default functionality from WordPress https://developer.wordpress.org/reference/classes/wp_query/.

    And as you can see from the documentation, sticky posts are not counted in the number of posts to be displayed on the page. So the provided custom code to make them behave like regular posts. Unfortunately, at this time it is not possible for the number of sticky posts to be counted in the number of output posts.

    Hope it clears.

    Regards,

    #572381

    josh-6874
    Participant

    I changed the number of output posts to ‘6’ and it correctly displays 6 posts. It’s only when the output post is ‘3’ that the problem persists (In other words, it displays 4 posts, including one sticky post). Is there a reason for this behaviour?

    #572503

    Hung Pham
    Keymaster

    Hi josh-6874,

    As I explained above that a sticky post is Always displayed, and when you choose to display 3 posts, it displays 4 posts and that is correct. But when you select 4 posts, 4 posts will be displayed because the sticky post has the 4th position in the order https://monosnap.com/file/OLjcNJ6TpxYIJSKP3bd6tIUh8cOnjt, and it is already taken into account in the posts per page.

    If the sticky post is the last on the list, then when displaying posts, 1 extra post will always be displayed. And if the sticky post is the first in the list, there will be no extra post.

    Hope it clears.

    Regards,

Viewing 21 posts - 1 through 21 (of 21 total)