Last active
September 3, 2019 09:00
-
-
Save wp-seopress/aae2f7af6755c5d903dcc34129f9796c to your computer and use it in GitHub Desktop.
Filter hierarchical post type query in HTML sitemap
This file contains hidden or 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 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