Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Kill attachment, search, author, daily archive pages */
- add_action('template_redirect', 'bwp_template_redirect');
- function bwp_template_redirect()
- {
- global $wp_query, $post;
- if ( is_attachment() || is_month() || is_year() || is_day())
- {
- $wp_query->set_404();
- }
- if (is_feed())
- {
- $attachment = get_query_var('attachment');
- $attachment = (empty($attachment)) ? get_query_var('attachment_id') : $attachment;
- $day = get_query_var('day');
- if (!empty($attachment) || !empty($day) )
- {
- $wp_query->set_404();
- $wp_query->is_feed = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement