Skip to content

Instantly share code, notes, and snippets.

@dcooney
Last active December 5, 2024 08:35
Show Gist options
  • Save dcooney/9b037efbd166b4dba5ae to your computer and use it in GitHub Desktop.
Save dcooney/9b037efbd166b4dba5ae to your computer and use it in GitHub Desktop.
Exclude posts from Ajax Load More
<?php
$features = array('1, 1530', '1514', '1471'); // Array of posts
if($features){
//Implode the posts and set a varible to pass to our exclude param.
$post__not_in = implode(",", $features);
}
echo do_shortcode('[ajax_load_more post__not_in="'.$post__not_in.'"]');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment