Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1251140

    Hello,
    I have a weird issue with the pagination on my product masonry. Everything works except for one thing : once you leave the first page, it is impossible to get back to it using the pagination link. The link to page 1 redirects to the current page (for example, if I’m on page 3, the “1” links to page 3), and the previous link, on page 2, redirects to page 2 (otherwise it works as intended). And on the last page, the “go to the first page” button links to, again, the current page. Do you have any idea what could cause this ?
    I’m putting a link to the website in private ; the masonry is on the home page.

    Thanks for your help !

    #1252241

    Hey JaimBateman,

    Thank you for the inquiry.

    This might be due to a third party plugin or a custom code added in the theme because we could not reproduce the issue on our own installation. Have you tried disabling the plugins or the modifications temporarily?

    Best regards,
    Ismael

    #1252500

    Hi,
    I’m having the same problem but with a different element (blog posts). I have inserted the “blog posts” block to show the news on my page which, through the theme settings, I have set as a blog page. Everything works correctly, except that if I try to click on the first element of the page or on the arrow to go back I cannot go back to the first page. I noticed the following:
    – the arrow to go back allows you to go to the previous page, but not to the first page;
    – the first element, page 1, takes the value “?avia-element-paging=2” if we are on page 2, “?avia-element-paging=3” if we are on page 3 and so on. In conclusion it is not possible to return to the blog home page.
    Could you let me know how to solve the problem?
    Thanks for your help!

    #1253734

    Hi,
    Sorry for the late reply, thank you to both of you for links to your sites. So in both cases the pagination [1] is not linking to the first page, but the position of [1] changes as the [<] pagination buttons are added and then after page 5 [1] drops off. So I believe I have it sorted out with this script, try adding this code to the end of your functions.php file in Appearance > Editor:

    @JaimBateman
    with your masonry pagination please try this:

    function custom_masonry_pagination_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
       var $this = $(".av-masonry-pagination nav.pagination a").eq(1);
       var count = $(".av-masonry-pagination nav.pagination a").length;
       var url = document.URL;
       var theURL = url.split("=")[0];
       if (count>4){
       if ($this.hasClass("inactive")){
       $this.attr("href", theURL + "=1");
       } else{}
       } else{}
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_masonry_pagination_script');


    @KunaWebAgency
    for your pagination-slider please try this:

    function custom_pagination_slider_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
       var $this = $(".pagination-wrap.pagination-slider nav.pagination a").eq(1);
       var count = $(".pagination-wrap.pagination-slider nav.pagination a").length;
       var url = document.URL;
       var theURL = url.split("=")[0];
       if (count>4){
       if ($this.hasClass("inactive")){
       $this.attr("href", theURL + "=1");
       } else{}
       } else{}
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_pagination_slider_script');

    I guess we could have just used nav.pagination a as the target and the code would have been the same, but I didn’t want any unexpected actions on other paginations.

    Best regards,
    Mike

    #1253882

    Hello Mike,

    And thanks for your help. Your code almost does the trick ! The only two issue left are :
    1 – when we are on page 2 of the pagination, the ‘previous’ button does not work (it links to the same page). Otherwise, it works well.
    2 – The ‘return to first page’ button (the one with the ‘<<‘ symbol, that appears when the link to page one isn’t on the screen) still links to the current displayed page and not the first page.

    Cheers, and thanks for all you’ve done so far !

    #1253938

    Hi,
    @jaimbateman, thanks for the feedback, so the [<<] only shows after page 4, I adjusted for this, and for the [<] on page 2.
    Please try replacing your code with this one:

    function custom_masonry_pagination(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
       var thistwo = $(".av-masonry-pagination nav.pagination a").eq(1);
       var thisone = $(".av-masonry-pagination nav.pagination a").eq(0);
       var count = $(".av-masonry-pagination nav.pagination a").length;
       var url = document.URL;
       var theURL = url.split("=")[0];
       if ($(count>4)){
       if (thistwo.hasClass("inactive")){
       thistwo.attr("href", theURL + "=1");
       }
       if ($(count>8)){
       thisone.attr("href", theURL + "=1");
       }
       if ($(count<8)){
       thisone.attr("href", theURL + "=1");
       }
    }
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_masonry_pagination');

    Best regards,
    Mike

    #1253952

    Hello again,

    Thanks for the updated code. Some things have changed for the better, others no so much… Thanks for taking the time, I really appreciate your help !
    Here’s the rundown now :
    – When on the first page : the ‘2’ and ‘3’ buttons do not work anymore, and link to the current page.
    – When on page 2 and 3 : the previous (‘<‘) button links to page one, and not previous page (only a problem on page 3, though).

    All other cases. : everything works. We’re getting closer !

    #1253957

    Hi,
    Thanks, I see an error I made, please remove the scripts so I can test fresh again from my side.

    Best regards,
    Mike

    #1253960

    Done, and cache flushed.

    #1254115

    Hi Mike,
    thanks for your help.
    I am sharing my solution because yours wasn’t complete:

    
    function custom_pagination_slider_script(){
    ?>
    <script>
    (function($){
    	$(document).ready(function() {
    		var thispag = $( ".pagination-wrap.pagination-slider nav.pagination a" );
    		var thisfirst = $( ".pagination-wrap.pagination-slider nav.pagination a" ).eq(0);
    		var thisone = $( ".pagination-wrap.pagination-slider nav.pagination a" ).eq(1);
    		var count = thispag.length;
    		var baseurl = location.protocol + '//' + location.host + location.pathname;
    		var url = document.URL;
    		var theURL = url.split( "=" )[0];
    		var theindex = url.split( "=" )[1];
    
    		if ( count > 0 ) {
    			if ( theindex == 1 ) {
    				thispag.attr( "href", baseurl );
    			} else if ( theindex > 1 && count < 5 ) {
    				thisfirst.attr( "href", baseurl );
    			} else if ( theindex == 2 && count > 4 ) {
    				thisfirst.attr( "href", baseurl );
    				thisone.attr( "href", baseurl );
    			} else if ( theindex == 3 && count > 4 ) {
    				thisfirst.attr( "href", theURL + "=" + ( theindex - 1 ) );
    				thisone.attr( "href", baseurl );
    			} else if ( theindex > 3 && count > 4 ) {
    				thisfirst.attr( "href", baseurl );
    				thisone.attr( "href", theURL + "=" + ( theindex - 1 ) );
    			}
    		}
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_pagination_slider_script');
    

    I hope it could help someone.
    Regards,
    Dario

    #1254357

    Hi,

    @KunaWebAgency
    thank you for sharing your solution. @JaimBateman I adjusted @KunaWebAgency’s solution for your masonry pagination and it seems to cover your points above, please give this script a try. Please note any issues you may see and then remove the script so I can adjust, if necessary.

    function custom_masonry_pagination_links(){
      ?>
      <script>
    (function($){
    	$(document).ready(function() {
    		var thispag = $( ".av-masonry-pagination nav.pagination a" );
    		var thisfirst = $( ".av-masonry-pagination nav.pagination a" ).eq(0);
    		var thisone = $( ".av-masonry-pagination nav.pagination a" ).eq(1);
    		var count = thispag.length;
    		var baseurl = location.protocol + '//' + location.host + location.pathname;
    		var url = document.URL;
    		var theURL = url.split( "=" )[0];
    		var theindex = url.split( "=" )[1];
    
    		if ( count > 0 ) {
    			if ( theindex == 1 ) {
    				thispag.attr( "href", baseurl );
    			} else if ( theindex > 1 && count < 5 ) {
    				thisfirst.attr( "href", baseurl );
    			} else if ( theindex == 2 && count > 4 ) {
    				thisfirst.attr( "href", baseurl );
    				thisone.attr( "href", baseurl );
    			} else if ( theindex == 3 && count > 4 ) {
    				thisfirst.attr( "href", theURL + "=" + ( theindex - 1 ) );
    				thisone.attr( "href", baseurl );
    			} else if ( theindex > 3 && count > 4 ) {
    				thisfirst.attr( "href", baseurl );
    				thisone.attr( "href", theURL + "=" + ( theindex - 1 ) );
    			}
    		}
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_masonry_pagination_links');

    Best regards,
    Mike

    #1254367

    Hello Mike,
    Excellent, everything works – thanks to KunaWeb too ! I’ll just leave the script in then.
    Just out of curiosity, do you have any idea why the pagination was behaving that way ? Could there be an issue with the enfold files ? It would seem weird that just the two of us were affected.

    Cheers, and thanks again !

    #1254654

    Hi,
    Very good, and thanks to KunaWeb for sharing 🙂
    I’m glad to hear this helps, I believe the dev team will need to adjust the core script, and I will submit this to them. I will leave this open for now and reply when I hear back from them.

    Best regards,
    Mike

    #1267477

    Hi,
    I have a very similar problem: We have a product grid (“Produkt-Raster”) on our frontpage, and from what I can see, this is the only element with pagination. Just like @JaimBateman I see correct links on page 1, but the link to page 1 on the other pages points to the current page.

    For example, this is the HTML on page 3/3:

    <div class="pagination-wrap pagination-slider ">
        <nav class="pagination">
            <span class="pagination-meta">Seite 3 von 3</span>
            <a href="https://www.carpathia-verlag.de/?avia-element-paging=3" class="inactive">1</a>
            <a href="https://www.carpathia-verlag.de/?avia-element-paging=2" class="inactive previous_page">2</a>
            <span class="current">3</span>
        </nav>
    </div>

    The code snippet from @KunaWebAgency seems to work for the moment, however I think this should be fixed upstream, shouldn’t it?

    Best,
    Robert

    #1268414

    Hi,

    Thank you for the inquiry.

    The solution that we provided in the following thread might help with the pagination issue.

    // https://kriesi.at/support/topic/the-grid-with-products-does-not-work-pagination/#post-1254673

    Best regards,
    Ismael

    #1268427

    Hi Ismael,

    indeed, this fix also works. My changes in the theme directory however will not be permanent. So, will there be a fix in the next update?

    Best regards,
    Robert

    #1268700

    Hi,
    Sorry for the late reply, this has been corrected and will be in the next update. Thank you for your patience.

    Best regards,
    Mike

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