cwp_megar_setup
Sets up theme defaults and registers support for various WordPress features.
Description
cwp_megar_setup();
Note that this function is hooked into the after_setup_theme hook, which runs before the init hook. The init hook is too late for some features, such as indicating support post thumbnails.
Usage
if ( !function_exists( 'cwp_megar_setup' ) ) { require_once '/functions.php'; } // NOTICE! Understand what this does before running. $result = cwp_megar_setup();
Defined (1)
The function is defined in the following location(s).
- /functions.php
- function cwp_megar_setup() {
- /**
- * Make theme available for translation
- * Translations can be filed in the /languages/ directory
- * If you're building a theme based on CWP-MegaR, use a find and replace
- * to change 'cwp-megar' to the name of your theme in all the template files
- */
- load_theme_textdomain( 'cwp-megar', get_template_directory() . '/languages' );
- /**
- * Add default posts and comments RSS feed links to head
- */
- add_theme_support( 'automatic-feed-links' );
- /**
- * Enable support for Post Thumbnails on posts and pages
- *
- * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
- */
- //add_theme_support( 'post-thumbnails' );
- /**
- * This theme uses wp_nav_menu() in one location.
- */
- register_nav_menus( array(
- 'primary' => __( 'Primary Menu', 'cwp-megar' ),
- 'footer' => __( 'Footer Menu', 'cwp-megar' ),
- 'sidebar_menu' => __( 'Sidebar menu', 'cwp-megar' ),
- ) );
- /**
- * Enable support for Post Formats
- */
- add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) );
- /**
- * Setup the WordPress core custom background feature.
- */
- add_theme_support( 'custom-background', apply_filters( 'cwp_megar_custom_background_args', array(
- 'default-color' => 'fefefe',
- 'default-image' => '',
- ) ) );
- /**
- * Implement the Custom Header feature.
- */
- //require get_template_directory() . '/inc/custom-header.php';
- $args = array(
- 'width' => 980,
- 'height' => 60,
- 'default-image' => '',
- 'uploads' => true,
- );
- add_theme_support( 'custom-header', $args );
- /**
- * Custom template tags for this theme.
- */
- require get_template_directory() . '/inc/template-tags.php';
- /**
- * Custom functions that act independently of the theme templates.
- */
- require get_template_directory() . '/inc/extras.php';
- /**
- * Customizer additions.
- */
- require get_template_directory() . '/inc/customizer.php';
- /**
- * Load Jetpack compatibility file.
- */
- require get_template_directory() . '/inc/jetpack.php';
- /**
- * Enabling Support for Post Thumbnails.
- */
- add_theme_support( 'post-thumbnails' );
- /**
- * Banner widget.
- */
- $widget_banner = locate_template( 'widgets/banner-widget/banner-widget.php', TRUE, TRUE );
- /**
- * Facebook like box widget.
- */
- $widget_facebook_box = locate_template( 'widgets/facebook-like-box/fb-like-box.php', TRUE, TRUE );
- }