generated from pascalmartineau/wp-skeleton
All checks were successful
WordPress deployment / deploy (push) Successful in 9s
32 lines
829 B
PHP
32 lines
829 B
PHP
<?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 );
|
|
}
|
|
}
|