Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter gbbdesigner

    (@gbbdesigner)

    Solved by adding the JS code at the bottom of this thread to the page.

    Post Widget Pagination Issue
    byu/TheGraphicDude inelementor

    Hi, one or more recent updates seem to have caused a problem with Elementor’s pagination for the posts element on this site: https://smartqa.org/articles/

    Clicking on page 2, it will try and go to https://smartqa.org/articles/2/ which just redirects back to page 1 (https://bydesign.co.za/blog/)

    and unable Directly accessing https://bydesign.co.za/blog/page/2/

    Please assist?

    Hi

    Since you are using our Pro features on your website, you’ll need to open a support ticket at my.elementor.com.

    www.ads-software.com rules state that commercial products are not supported here.

    @davidr90 for your information and verybody using posts widget with pagination, I have a quick fix here that works on the base skin, it replaces /2 /3 /3 to /page/2 page/3 /page/4, add following code in wp-content/plugins/elementor-pro/modules/posts/skins/skin-base.php line 1000, function render_loop_footer :

    BEFORE :

    
    $links = paginate_links( $paginate_args );
    

    AFTER

    			
    $links = paginate_links( $paginate_args );
    $links=str_replace("/2","/page/2",$links);//<--* breizhwave2020-10
    $links=str_replace("/3","/page/3",$links);//<--* breizhwave2020-10
    $links=str_replace("/4","/page/4",$links);//<--* breizhwave2020-10
    
    

    @davidr90 quick fix, works, but worth noting for future versions because updates obvious:y break the hack, already opened a support ticket a few months ago… ?? Remember The Milk !!!

    @davidr90 what do you think ? any work in progress on that issue ? thanks ??

    https://github.com/elementor/elementor/issues/12126

    Not a few years have passed to fix it, where to hurry? Better to add unnecessary functionality like a “custom code”. Users still pay for a subscription…. where to hurry? truth @davidr90

    laudag

    (@laudag)

    OK, I tried again to reach the support about this problem. Because if the hack is perfect, hte next update wil erase it. I don’t want to watch to put it back each time.*
    The support spent some time and finaly gave me an answer and a solution :
    “I can confirm that this happens because the “News” page is not assigned as your Posts page.
    Currently, the News page is just a regular WordPress page, so the next page will use “/2” as the next page link instead of “/page/2” (which is only used for WordPress’ Posts page and archive pages). If you really wish to use “/page/2” as your pagination link, you will need to do the following:

    1. Edit your news page, and save it as a template (https://elementor.com/help/save-page-as-template/).
    2. Go to Settings > Reading, and set “News” as your Posts page.
    3. Since the News page will become an archive page for your posts, it cannot be directly edited with Elementor. To customize this page, kindly go to Templates > Theme Builder, and create an Archive template.
    4. Import the template you just saved into the Archive template you have created.
    5. Change the Posts widget’s query to “Current Query”.”

    It works… but only to display ALL the posts.

    I could find a way to display a specific category :
    1. Edit your news page, and save it as a template (https://elementor.com/help/save-page-as-template/).
    2. No need to go go to Settings > Reading, and set any page.
    3. Then go to Templates > Theme Builder, and create an Archive template.
    4. Import the template you just saved into the Archive template you have created.
    5. Choose as condition one or several post categories
    6. Change the Posts widget’s query to “Current Query”.
    7.Then pagination works.
    8.It seems that to set the number of post to display, you must to Settings > Reading.

    @laudag well done, I myself cannot modify the existing templates so for those who still use the code hack for the wp-content/plugins/elementor-pro/modules/posts/skins/skin-base.php line 1000, function render_loop_footer , I should mention that $links is actually an array so here’s an update :

    if (is_array($links)) 
                    foreach($links as $k=>$v)
                    if (!strstr($v, "/page")) {
                    $links[$k] = preg_replace('/\/(\d)/', "/page/$1", $links[$k]);
    
                }

    The fix for me was to delete the “Category Base” under Settings ? Permalinks

    @fvanschaik It’s good that you were able to decide for yourself)
    But I think…this is not a panacea, as I have no categories. And the pagination doesn’t work

    @danchik83 and what if you choose custom structure and save?

    @fvanschaik I have it by default:
    https://***/sample-post/
    At that and it doesn’t work. Still could not solve the problem, threw(

    • This reply was modified 2 years, 3 months ago by Artem.
    • This reply was modified 2 years, 3 months ago by Artem.

    Solved: Theme and plugins link conflicts.

    Cause of problem:
    I’m using a theme that I bought and Cooked Plugin.

    Both, in plugin and theme, it is possible to set links for custom Post Types designed out-of-the-box in plugin and theme.

    So, I designed my custom pages for Archive and Page View with Elementor and set permalink with same url in theme and plugins configured in theme and plugin options. It causes a conflict with a 404 page not found as result for pagination pages like “services/2” or “recipes/2”.

    How I resolved:

    1. I just changed the default url for post types in my theme and plugin to new ones.
    2. I created Templates for archives in Elementor Theme Builder.
    3. I create a pages and set permalink that I wanted with a different defined in theme and plugin.

    • This reply was modified 2 years, 2 months ago by molavec.
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Elementor Pagination Not Working’ is closed to new replies.