Skip to content

Instantly share code, notes, and snippets.

@AustinGil
Created April 4, 2017 18:50
Show Gist options
  • Save AustinGil/ecde3a29afaadfae6bd5989becce244e to your computer and use it in GitHub Desktop.
Save AustinGil/ecde3a29afaadfae6bd5989becce244e to your computer and use it in GitHub Desktop.
Loading more posts with AJAX
/**
* AJAX load template part
*/
function prefix_ajax_load_template_part() {
echo get_template_part('templates/ajax-template-part');
die();
}
add_action('wp_ajax_nopriv_ajax_load_initiatives', 'prefix_ajax_load_template_part');
add_action('wp_ajax_ajax_load_initiatives', 'prefix_ajax_load_template_part');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment