Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active August 15, 2016 02:44
Show Gist options
  • Save billerickson/8b9d6c6b8974fc01a238 to your computer and use it in GitHub Desktop.
Save billerickson/8b9d6c6b8974fc01a238 to your computer and use it in GitHub Desktop.
<?php
/**
* AJAX Load More
* @link http://www.billerickson.net/infinite-scroll-in-wordpress
*/
function be_ajax_load_more() {
$data = 'Additional posts go here';
wp_send_json_success( $data );
wp_die();
}
add_action( 'wp_ajax_be_ajax_load_more', 'be_ajax_load_more' );
add_action( 'wp_ajax_nopriv_be_ajax_load_more', 'be_ajax_load_more' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment