generated from pascalmartineau/wp-skeleton
feat: Initial plugins and theme
All checks were successful
WordPress deployment / deploy (push) Successful in 9s
All checks were successful
WordPress deployment / deploy (push) Successful in 9s
This commit is contained in:
31
wp-content/themes/ccat/includes/core/theme-setup.php
Normal file
31
wp-content/themes/ccat/includes/core/theme-setup.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
// Setup theme
|
||||
add_action( 'after_setup_theme', 'ccat_after_setup_theme' );
|
||||
function ccat_after_setup_theme() {
|
||||
// Load textdomain
|
||||
load_theme_textdomain( 'ccat', get_theme_file_path( 'languages' ) );
|
||||
|
||||
// Theme features
|
||||
add_theme_support( 'custom-logo' );
|
||||
add_theme_support( 'editor-styles' );
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
// add_theme_support( 'woocommerce' );
|
||||
remove_theme_support( 'core-block-patterns' );
|
||||
|
||||
// Register menus
|
||||
register_nav_menu( 'main', "Menu principal" );
|
||||
register_nav_menu( 'top', "Menu du haut" );
|
||||
|
||||
// Register sidebars
|
||||
}
|
||||
|
||||
// Disable unwanted permalinks
|
||||
add_action( 'template_redirect', 'ccat_disable_permalinks' );
|
||||
function ccat_disable_permalinks() {
|
||||
global $wp_query;
|
||||
if ( is_author() || is_attachment() || is_date() ) {
|
||||
$wp_query->set_404();
|
||||
status_header( 404 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user