Skip to content

Instantly share code, notes, and snippets.

@wpmu-authors
Created April 28, 2022 18:41
Show Gist options
  • Save wpmu-authors/a19ff072e61829a3dc080dda04754cd5 to your computer and use it in GitHub Desktop.
Save wpmu-authors/a19ff072e61829a3dc080dda04754cd5 to your computer and use it in GitHub Desktop.
/**********************************************************************************
wpmu_theme_setup - sets up themes
- adds theme support for post formats, post thumbnails, HTML5 and automatic feed links
- registers a translation file
- registers navigation menus
**********************************************************************************/
function wpmu_theme_setup() {
/*******************************
Start by adding theme support
*******************************/
/* post formats */
add_theme_support( 'post-formats', array( 'aside', 'quote' ) );
/* post thumbnails */
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
/* HTML5 */
add_theme_support( 'html5' );
/* automatic feed links */
add_theme_support( 'automatic-feed-links' );
/*******************************
Translation file
*******************************/
load_child_theme_textdomain( 'wpmu-theme', get_stylesheet_directory() . '/languages' );
/*******************************
Navigation menus
*******************************/
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'wpmu-theme' ),
'sidebar' => __( 'Sidebar Navigation', 'wpmu-theme' ),
) );
}
add_action( 'after_setup_theme', 'wpmu_theme_support' );
@cracki
Copy link

cracki commented Feb 9, 2023

add_action( 'after_setup_theme', 'wpmu_theme_setup' ); is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment