CrouchingBruin

TwentyFourteen child function.php

Dec 10th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.62 KB | None | 0 0
  1. <?php
  2.  
  3. add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
  4. function enqueue_parent_theme_style() {
  5. wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
  6. }
  7.  
  8. /**
  9.  * Twenty Fourteen setup.
  10.  *
  11.  * Set up theme defaults and registers support for various WordPress features.
  12.  *
  13.  * Note that this function is hooked into the after_setup_theme hook, which
  14.  * runs before the init hook. The init hook is too late for some features, such
  15.  * as indicating support post thumbnails.
  16.  *
  17.  * @since Twenty Fourteen 1.0
  18.  */
  19. function twentyfourteen_setup() {
  20.  
  21.     /*
  22.      * Make Twenty Fourteen available for translation.
  23.      *
  24.      * Translations can be added to the /languages/ directory.
  25.      * If you're building a theme based on Twenty Fourteen, use a find and
  26.      * replace to change 'twentyfourteen' to the name of your theme in all
  27.      * template files.
  28.      */
  29.     load_theme_textdomain( 'twentyfourteen', get_template_directory() . '/languages' );
  30.  
  31.     // This theme styles the visual editor to resemble the theme style.
  32.     add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) );
  33.  
  34.     // Add RSS feed links to <head> for posts and comments.
  35.     add_theme_support( 'automatic-feed-links' );
  36.  
  37.     // Enable support for Post Thumbnails, and declare two sizes.
  38.     add_theme_support( 'post-thumbnails' );
  39.     set_post_thumbnail_size( 672, 372, true );
  40.     add_image_size( 'twentyfourteen-full-width', 1038, 576, true );
  41.  
  42.     // This theme uses wp_nav_menu() in two locations.
  43.     register_nav_menus( array(
  44.         'primary'   => __( 'Top primary menu', 'twentyfourteen' ),
  45.         'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ),
  46.     ) );
  47.  
  48.     /*
  49.      * Switch default core markup for search form, comment form, and comments
  50.      * to output valid HTML5.
  51.      */
  52.     add_theme_support( 'html5', array(
  53.         'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
  54.     ) );
  55.  
  56.     /*
  57.      * Enable support for Post Formats.
  58.      * See http://codex.wordpress.org/Post_Formats
  59.      */
  60.     add_theme_support( 'post-formats', array(
  61.         'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery',
  62.     ) );
  63.  
  64.     // This theme allows users to set a custom background.
  65.     add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array(
  66.         'default-color' => 'f5f5f5',
  67.     ) ) );
  68.  
  69.     // Add support for featured content.
  70.     add_theme_support( 'featured-content', array(
  71.         'featured_content_filter' => 'twentyfourteen_get_featured_posts',
  72.         'max_posts' => 6,
  73.     ) );
  74.  
  75.     // This theme uses its own gallery styles.
  76.     add_filter( 'use_default_gallery_style', '__return_false' );
  77. }
  78.  
  79. ?>
Advertisement
Add Comment
Please, Sign In to add comment