Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wp-seopress/aae2f7af6755c5d903dcc34129f9796c to your computer and use it in GitHub Desktop.
Save wp-seopress/aae2f7af6755c5d903dcc34129f9796c to your computer and use it in GitHub Desktop.
Filter hierarchical post type query in HTML sitemap
function sp_sitemaps_html_pages_query($args2, $cpt_key) {
//default:
//$args2 = array('post_type' => $cpt_key, 'include'=>$postslist, 'sort_order' => $seopress_xml_sitemap_html_order_option, 'sort_column' => $seopress_xml_sitemap_html_orderby_option);
$args2['exclude'] = 10;
//exclude post with ID 10
return $args2;
}
add_filter( 'seopress_sitemaps_html_pages_query', 'sp_sitemaps_html_pages_query', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment