Support » Plugin: WordPress Infinite Scroll - Ajax Load More » Where to put ‘almDone()’ Callback Function

  • Resolved j6333alex

    (@j6333alex)


    Hi Darren – Could you please help me if you have a minute? I have tried to find this issue on FAQ but no luck.

    I want to use this Callback Function but I have no idea where to paste it:

    $(function() {
    $.fn.almDone = function(){
    console.log(‘All posts have been loaded!’);
    };
    })(jQuery);

    —-

    I’m guessing it goes in src/js/ajax-load-more.js but I have copied it in there and it doesn’t work.

    Sorry for the rookie question.

    Big fan of the plugin!

    Thank you !!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dcooney

    (@dcooney)

    HI @j6333alex,
    A callback would usually go inside a custom JavaScript file, you dont want to place it where you have… that file is compiled and is not used.

    In most cases, themes have a custom scripts area in the admin.
    If not, this plugin is good for this purpose.
    https://wordpress.org/plugins/custom-css-js/

    Hope that helps.

    Thanks for your fast reply.

    Using the custom-css-js plugin, I have managed to get this code into the Footer. But still can’t get the almDone callback to work.

    Code that is now in my footer:

    <script type=”text/javascript”>
    jQuery(document).ready(function( $ ){
    $(function() {
    $.fn.almDone = function(){
    console.log(‘All posts have been loaded!’);
    };
    })(jQuery);
    });

    </script>

    Any ideas? Thank you in advance.

    Ignore this – I’m an idiot

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where to put ‘almDone()’ Callback Function’ is closed to new replies.