FadeIn Ajax returned posts in wordpress

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;

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

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


Any ideas greatly appreciated!

Read more here: FadeIn Ajax returned posts in wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *