-
-
Save raiden808/e9c82fec988e46f9539c4bf23723cff0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function more_post_ajax(){ | |
$offset = $_POST["offset"]; | |
$ppp = $_POST["ppp"]; | |
header("Content-Type: text/html"); | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => $ppp, | |
'offset' => $offset, | |
); | |
$loop = new WP_Query($args); | |
while ($loop->have_posts()) { $loop->the_post(); | |
echo '<li>' . get_the_title() . '</li>'; | |
} | |
exit; | |
} | |
add_action('wp_ajax_nopriv_more_post_ajax', 'more_post_ajax'); | |
add_action('wp_ajax_more_post_ajax', 'more_post_ajax'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment