diff --git a/htdocs/wp-content/themes/lawcarta/functions.php b/htdocs/wp-content/themes/lawcarta/functions.php index 18129cd..64a4f14 100644 --- a/htdocs/wp-content/themes/lawcarta/functions.php +++ b/htdocs/wp-content/themes/lawcarta/functions.php @@ -250,5 +250,16 @@ function remove_width_attribute( $html ) { return $html; } +/* Register template redirect action callback */ +add_action('template_redirect', 'meks_remove_wp_archives'); + +/* Remove archives */ +function meks_remove_wp_archives(){ + //If we are on category or tag or date or author archive + if( is_category() || is_tag() || is_date() || is_author() ) { + global $wp_query; + $wp_query->set_404(); //set to 404 not found page + } +}