responsive_II_setup

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

Description

responsive_II_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( 'responsive_II_setup' ) ) { 
  2. require_once '/includes/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = responsive_II_setup(); 
  7.  

Defined (1)

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

/includes/functions.php  
  1. function responsive_II_setup() { 
  2.  
  3. global $content_width; 
  4.  
  5. /** 
  6. * Set the content width based on the theme's design and stylesheet. 
  7. */ 
  8. if ( ! isset( $content_width ) ) { 
  9. $content_width = 750; 
  10.  
  11. /** 
  12. * Responsive is available for translations. 
  13. * The translation files are in the /languages/ directory. 
  14. * Translations are pulled from the WordPress default lanaguge folder 
  15. * then from the child theme and then lastly from the parent theme. 
  16. * @link http://codex.wordpress.org/Function_Reference/load_theme_textdomain 
  17. */ 
  18. $domain = 'responsive-II'; 
  19.  
  20. load_theme_textdomain( $domain, WP_LANG_DIR . '/responsive/' ); 
  21. load_theme_textdomain( $domain, get_stylesheet_directory() . '/languages/' ); 
  22. load_theme_textdomain( $domain, get_template_directory() . '/languages/' ); 
  23.  
  24. // Add default posts and comments RSS feed links to head. 
  25. add_theme_support( 'automatic-feed-links' ); 
  26.  
  27. /** 
  28. * Enable support for Post Thumbnails on posts and pages. 
  29. * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 
  30. */ 
  31. add_theme_support( 'post-thumbnails' ); 
  32.  
  33. /** 
  34. * Enable support for custom menus 
  35. */ 
  36. add_theme_support( 'menus' ); 
  37.  
  38. /** 
  39. * This feature enables woocommerce support for a theme. 
  40. * @link http://docs.woothemes.com/document/third-party-custom-theme-compatibility/#section-2 
  41. */ 
  42. add_theme_support( 'woocommerce' ); 
  43.  
  44. /** 
  45. * This feature enables custom-menus support for a theme. 
  46. * @see http://codex.wordpress.org/Function_Reference/register_nav_menus 
  47. */ 
  48. register_nav_menus( array( 
  49. 'top-menu' => __( 'Top Menu', 'responsive-II' ),  
  50. 'header-menu' => __( 'Header Menu', 'responsive-II' ),  
  51. 'sub-header-menu' => __( 'Sub-Header Menu', 'responsive-II' ),  
  52. 'footer-menu' => __( 'Footer Menu', 'responsive-II' ) 
  53. ) ); 
  54.  
  55. // Enable support for HTML5 markup. 
  56. add_theme_support( 'html5', array( 
  57. 'comment-list',  
  58. 'search-form',  
  59. 'comment-form',  
  60. 'gallery',  
  61. 'caption',  
  62. ) ); 
  63.  
  64. // Setup the WordPress core custom background feature. 
  65. add_theme_support( 
  66. 'custom-background',  
  67. apply_filters( 'responsive_II_custom_background_args', array( 
  68. // Background default color 
  69. 'default-color' => '#efefef',  
  70. ) ) 
  71. ); 
  72.  
  73. add_theme_support( 'woocommerce' ); 
  74.