add_action('template_redirect', 'attachment_redirect');
function attachment_redirect() {
global $post;
if (is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0)) {
wp_redirect(get_permalink($post->post_parent), 301);
exit;
}
}
add_action('init', 'remove_category_base');
function remove_category_base() {
global $wp_rewrite;
$wp_rewrite->category_base = '';
$wp_rewrite->flush_rules();
}
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'rsd_link' );