Skip to content

Instantly share code, notes, and snippets.

@lumpysimon
Created October 1, 2014 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lumpysimon/2942fa7d71859c35f566 to your computer and use it in GitHub Desktop.
Save lumpysimon/2942fa7d71859c35f566 to your computer and use it in GitHub Desktop.
Better XML Sitemaps (WordPress plugin): set cache folder and exclude pages
<?php
defined( 'ABSPATH' ) or die();
$ll_sitemap = new ll_sitemap;
class ll_sitemap {
function __construct() {
add_filter( 'bwp_gxs_cache_dir', array( $this, 'cache_dir' ) );
add_filter( 'bwp_gxs_excluded_posts', array( $this, 'exclude_pages' ), 10, 2 );
}
function cache_dir() {
return WP_CONTENT_DIR . '/sitemaps';
}
function exclude_pages( $excluded, $post_type ) {
switch ( $post_type ) {
case 'page' :
return array( 7, 8, 42, 94, 95, 122, 123, 145 );
break;
}
return array();
}
} // class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment