Disable Attachment Pages (copy)

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

Disable Attachment Pages 3

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

Disable Attachment Pages 2

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

Disable Attachment Pages

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

Disable Author Archive

/* Get Statuscode 404 for existing & non-existing author archives. */ add_action( ‘template_redirect’, function() { if ( isset( $_GET[‘author’] ) || is_author() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } }, 1 ); /* Remove the Author Links…Continue reading

Disable Complianz for logged in users

function cmplz_my_filter_site_needs_cookiewarning( $cookiewarning_required) { //don’t show cookie banner for logged in users if ( is_user_logged_in() ) { $cookiewarning_required = false; if (!defined(‘CMPLZ_DO_NOT_BLOCK’) ) define(‘CMPLZ_DO_NOT_BLOCK’, true); } return $cookiewarning_required; } add_filter( ‘cmplz_site_needs_cookiewarning’, ‘cmplz_my_filter_site_needs_cookiewarning’ );Continue reading

Disable Attachment Pages

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

Disable Attachment Pages

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading