Remove Pages by Template
-
Was wondering if there is any ability to remove pages by page template server side. The code below shows an implementation that we attempted based on your filter_title_link filter.However, it still renders the HTML elements on the page for the removed items. Any help would be most appreciated. Thanks!
Gravitate Dev Teamfunction filter_title_link( $title_link, $post_id ) {
$template_slug = get_page_template_slug($post_id);
if ( $template_slug === ‘page-test-template.php’) {
$template_link = ‘<span class=”template”></span>’;
$title_link = $template_link;
} else {
$title_link = $title_link;
}return $title_link;
}
add_filter( ‘simple_sitemap_title_link_text’, ‘filter_title_link’, 10, 2 );
- The topic ‘Remove Pages by Template’ is closed to new replies.