I have been using this code from Lauren Gray:
https://gist.github.com/graylaurenm/86daa4f23aa8749c0933f72133ac7106
on my Wordpress site, and it works really well for the homepage and archive loops - any that are built into the main wp_Query. However I have created a new custom WP_Query and the AJAX doesn't work, it says "no more articles found" on click of the button...
$loop = new WP_Query( array(
'post_type' => 'post',
'paged' => $paged,
'posts_per_page' => 10
) );
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post();
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
add_action('genesis_entry_header','add_play_button');
echo '<article class="' . $countClasses . implode( ' ', get_post_class() ) . '">'; // add column class
do_action( 'genesis_entry_header' );
echo '</article>';
endwhile;
if ( $loop->max_num_pages > 1 ) :
echo '<div class="load-more"><a class="load-more-button" id="'.$pageType.'"><i class="fa fa-caret-down" aria-hidden="true"></i> Load More</a></div>';
endif;
endif;
What edits do I need to make to her code so it works with a custom loop like above?