everbox_theme_setup

Sets up theme defaults and registers support for various WordPress features.

Description

everbox_theme_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 for post thumbnails.


Usage

  1. if ( !function_exists( 'everbox_theme_setup' ) ) { 
  2. require_once '/inc/theme-setup.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = everbox_theme_setup(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/theme-setup.php  
  1. function everbox_theme_setup() { 
  2.  
  3. /** 
  4. * Make theme available for translation. 
  5. * Translations can be filed in the /languages/ directory. 
  6. * If you're building a theme based on EverBox, use a find and replace 
  7. * to change 'everbox' to the name of your theme in all the template files 
  8. */ 
  9. load_theme_textdomain( 'everbox', get_template_directory() . '/languages' ); 
  10.  
  11. // Add default posts and comments RSS feed links to head. 
  12. add_theme_support( 'automatic-feed-links' ); 
  13.  
  14. /** 
  15. * Let WordPress manage the document title. 
  16. * By adding theme support, we declare that this theme does not use a 
  17. * hard-coded <title> tag in the document head, and expect WordPress to 
  18. * provide it for us. 
  19. */ 
  20. add_theme_support( 'title-tag' ); 
  21.  
  22. /** 
  23. * Enable support for Post Thumbnails on posts and pages. 
  24. * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 
  25. */ 
  26. add_theme_support( 'post-thumbnails' ); 
  27. set_post_thumbnail_size( 320, 320, true ); 
  28. add_image_size( '120x100', 120, 100, true ); 
  29.  
  30. // This theme uses wp_nav_menu() in one location. 
  31. register_nav_menus( array( 
  32. 'primary' => __( 'Primary Menu', 'everbox' ),  
  33. 'footer' => __( 'Sidebar Menu', 'everbox' ) 
  34. ) ); 
  35.  
  36. /** 
  37. * Switch default core markup for search form, comment form, and comments 
  38. * to output valid HTML5. 
  39. */ 
  40. add_theme_support( 'html5', array( 
  41. 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',  
  42. ) ); 
  43.