• Resolved Fropky

    (@fropki)


    I use Ajax load more with Next Page addon. it load pages without Next button click. Like
    example.com/artcile-name
    example.com/artcile-name/2
    example.com/artcile-name/3

    example.com/artcile-name/10

    Now if a user open example.com/artcile-name/5 page it load page from /5 location but it also /2 /3 /4 page on top of that. Is there any way possible not to load previous slides of pages when A user is opting to load a particular page. Just load /5 and slides after that?

    PS: why it is necessary: in above example if page /5 is loaded all the ad loaded before on first page /2,/3,/4 are never viewed by anyone hence it become a very huge issue.

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @fropki How would a user ever view page 1, 2,3, 4 etc if they were not loaded at page load? This is a problem i’ve been trying to work though.

    Thread Starter Fropky

    (@fropki)

    What if website do not want to show them first /2 /3 /4 page in case he opted to open /5

    Plugin Author Darren Cooney

    (@dcooney)

    Yes, this is exactly the issue I’ve been trying to work through.

    So, what if they did want to view page 2?

    Thread Starter Fropky

    (@fropki)

    again for example. Think of it as a crawler issue. E.g. Google Adsense Bot.

    User visit a page which has 30 page. Website show 1 ad every 2 slide. Now A user has clicked on ad on 15th page. example.com/article-apge/15. Google will visit /15 page but all the ad before that will also be loaded. So website will get very less revenue in this case.

    So there should be an option for website to decide whether they want to show slides before that or not.

    • This reply was modified 5 years, 1 month ago by Fropky.
    • This reply was modified 5 years, 1 month ago by Fropky.
    Plugin Author Darren Cooney

    (@dcooney)

    Yea not ideal. A setting might be a good solution for this.
    A user could never reach page 14 though, if they loaded page 15 for example.

    Thread Starter Fropky

    (@fropki)

    Can you please send me an option to change in code? I would love to try it as an experiment for my live site?

    • This reply was modified 5 years, 1 month ago by Fropky.
    Plugin Author Darren Cooney

    (@dcooney)

    I don’t have anything ready or tested, but I can have a look tomorrow for you.

    Thread Starter Fropky

    (@fropki)

    Thanks. I will wait for piece of code.

    Plugin Author Darren Cooney

    (@dcooney)

    I can’t guarantee I’ll have it solved by tomorrow.

    Thread Starter Fropky

    (@fropki)

    I fully understand. I will wait patiently.

    Plugin Author Darren Cooney

    (@dcooney)

    @fropki

    I was able to solve this.

    in /core/classes/class.alm-shortcode.php line 1050

    Add the following:
    $nextpage_is_paged = apply_filters('alm_nextpage_paged', $nextpage_is_paged);

    Then in your functions php.

    add_filter('alm_nextpage_paged', function(){
    	return false;
    });

    Let me know how that works.
    I’ll be including this in the next ALM release.

    Thread Starter Fropky

    (@fropki)

    Thanks D. It is working perfectly fine.

    Thread Starter Fropky

    (@fropki)

    Just a small issue. I am still using Jquery version. Your solution work find. Except 1 console error in chrome.

    alm-next-page.min.js?ver=1.2.0:1 Uncaught TypeError: Cannot read property ‘top’ of undefined
    at Object.almNextPage.init (alm-next-page.min.js?ver=1.2.0:1)
    at HTMLDocument.<anonymous> (alm-next-page.min.js?ver=1.2.0:1)
    at i (jquery.js?ver=1.12.4-wp:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
    at Function.ready (jquery.js?ver=1.12.4-wp:2)
    at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)
    at HTMLDocument.c (rocket-loader.min.js:1)
    at l (rocket-loader.min.js:1)
    at t.simulateStateAfterDeferScriptsActivation (rocket-loader.min.js:1)
    at Object.callback (rocket-loader.min.js:1)

    • This reply was modified 5 years, 1 month ago by Fropky.
    Thread Starter Fropky

    (@fropki)

    Do I need to remove this piece of code

    if(startPage > 1){ // Move user to current page on page load.
    var top = $(‘.alm-nextpage[data-id=’+startPage+’]’).offset().top – startPageOffset + 5;
    $(‘html, body’).animate({ scrollTop: top +’px’ }, 1, function(){
    almNextPage.popstate = false;
    });
    }

    Thread Starter Fropky

    (@fropki)

    or Do we need to assign anything else of this variable
    var top = $(‘.alm-nextpage[data-id=’+startPage+’]’).offset().top – startPageOffset + 5;

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Next Page Addon issue.’ is closed to new replies.