I am trying to have posts displayed by ajax “load more” button use FadeIn(). The issue I am having is that it appears to only FadeIn one post of the next group that gets loaded via ajax. Here is my code so far;

$.ajax({
    url : ajax_post_loader_params.ajaxurl,
    data : data,
    type : 'POST',
    beforeSend : function ( xhr ) {
        button.text('Loading...'); 
    },
    success : function( data ){
        if( data ) { 
            button.text( 'Load More posts' ).prev().after(data).hide().fadeIn(1000);;
            ajax_post_loader_params.current_page++;

            if ( ajax_post_loader_params.current_page == ajax_post_loader_params.max_page ) 
                button.remove();
        } else {
            button.remove(); //
        }
    }
});

});

Any ideas greatly appreciated!

Read more here: FadeIn Ajax returned posts in wordpress


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: