1/**
2 * MyFirstTheme's functions and definitions
3 *
4 * @package MyFirstTheme
5 * @since MyFirstTheme 1.0
6 */
7
8/**
9 * First, let's set the maximum content width based on the theme's design and stylesheet.
10 * This will limit the width of all uploaded images and embeds.
11 */
12if ( ! isset( $content_width ) )
13 $content_width = 800; /* pixels */
14
15if ( ! function_exists( 'myfirsttheme_setup' ) ) :
16/**
17 * Sets up theme defaults and registers support for various WordPress features.
18 *
19 * Note that this function is hooked into the after_setup_theme hook, which runs
20 * before the init hook. The init hook is too late for some features, such as indicating
21 * support post thumbnails.
22 */
23function myfirsttheme_setup() {
24
25 /**
26 * Make theme available for translation.
27 * Translations can be placed in the /languages/ directory.
28 */
29 load_theme_textdomain( 'myfirsttheme', get_template_directory() . '/languages' );
30
31 /**
32 * Add default posts and comments RSS feed links to <head>.
33 */
34 add_theme_support( 'automatic-feed-links' );
35
36 /**
37 * Enable support for post thumbnails and featured images.
38 */
39 add_theme_support( 'post-thumbnails' );
40
41 /**
42 * Add support for two custom navigation menus.
43 */
44 register_nav_menus( array(
45 'primary' => __( 'Primary Menu', 'myfirsttheme' ),
46 'secondary' => __('Secondary Menu', 'myfirsttheme' )
47 ) );
48
49 /**
50 * Enable support for the following post formats:
51 * aside, gallery, quote, image, and video
52 */
53 add_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );
54}
55endif; // myfirsttheme_setup
56add_action( 'after_setup_theme', 'myfirsttheme_setup' );
57