megaresponsive_lite_setup

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

Description

megaresponsive_lite_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

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

Defined (1)

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

/functions.php  
  1. function megaresponsive_lite_setup() { 
  2.  
  3.  
  4.  
  5. /** 
  6. * Make theme available for translation 
  7. * Translations can be filed in the /languages/ directory 
  8. * If you're building a theme based on megaresponsive-lite, use a find and replace 
  9. * to change 'megaresponsive-lite' to the name of your theme in all the template files 
  10. */ 
  11.  
  12. load_theme_textdomain( 'megaresponsive-lite', get_template_directory() . '/languages' ); 
  13.  
  14.  
  15.  
  16. /** 
  17.   
  18. * Add default posts and comments RSS feed links to head 
  19.   
  20. */ 
  21.  
  22. add_theme_support( 'automatic-feed-links' ); 
  23.  
  24.  
  25.  
  26. /** 
  27.   
  28. * Enable support for Post Thumbnails on posts and pages 
  29.   
  30.   
  31. * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 
  32.   
  33. */ 
  34.  
  35. add_theme_support( 'post-thumbnails' ); 
  36.  
  37.  
  38.  
  39. /** 
  40.   
  41. * This theme uses wp_nav_menu() in one location. 
  42.   
  43. */ 
  44.  
  45. register_nav_menus( array( 
  46.  
  47. 'primary' => __( 'Primary Menu', 'megaresponsive-lite' ),  
  48.  
  49. 'footer' => __( 'Footer Menu', 'megaresponsive-lite' ),  
  50.  
  51. 'sidebar_menu' => __( 'Sidebar menu', 'megaresponsive-lite' ),  
  52.  
  53. ) ); 
  54.  
  55.  
  56.  
  57. /** 
  58.   
  59. * Enable support for Post Formats 
  60.   
  61. */ 
  62.  
  63. add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); 
  64.  
  65.  
  66.  
  67. /** 
  68.   
  69. * Setup the WordPress core custom background feature. 
  70.   
  71. */ 
  72.  
  73. add_theme_support( 'custom-background', apply_filters( 'cwp_megar_custom_background_args', array( 
  74.  
  75. 'default-color' => 'fefefe',  
  76.  
  77. 'default-image' => '',  
  78.  
  79. ) ) ); 
  80.  
  81.  
  82.  
  83.  
  84.  
  85. /** 
  86.   
  87. * Implement the Custom Header feature. 
  88.   
  89. */ 
  90.  
  91. $args = array( 
  92.  
  93. 'width' => 1700,  
  94.  
  95. 'height' => 90,  
  96.  
  97. 'default-image' => '',  
  98.  
  99. 'uploads' => true,  
  100.  
  101. ); 
  102.  
  103. add_theme_support( 'custom-header', $args ); 
  104.  
  105.  
  106.  
  107. /** 
  108.   
  109. * Custom template tags for this theme. 
  110.   
  111. */ 
  112.  
  113. require get_template_directory() . '/inc/template-tags.php'; 
  114.  
  115.  
  116.  
  117. /** 
  118.   
  119. * Custom functions that act independently of the theme templates. 
  120.   
  121. */ 
  122.  
  123. require get_template_directory() . '/inc/extras.php'; 
  124.  
  125.  
  126.  
  127. /** 
  128.   
  129. * Customizer additions. 
  130.   
  131. */ 
  132.  
  133. require get_template_directory() . '/inc/customizer.php'; 
  134.  
  135.  
  136.  
  137. /** 
  138.   
  139. * Load Jetpack compatibility file. 
  140.   
  141. */ 
  142.  
  143. require get_template_directory() . '/inc/jetpack.php'; 
  144.  
  145.  
  146.  
  147. /** 
  148.   
  149. * Enabling Support for Post Thumbnails. 
  150.   
  151. */ 
  152.  
  153. add_theme_support( 'post-thumbnails' );  
  154.  
  155.  
  156.  
  157. /** 
  158.   
  159. * Banner widget. 
  160.   
  161. */ 
  162.  
  163. $widget_banner = locate_template( 'widgets/banner-widget/banner-widget.php', TRUE, TRUE ); 
  164.  
  165.  
  166.  
  167. /** 
  168.   
  169. * Facebook like box widget. 
  170.   
  171. */ 
  172.  
  173. $widget_facebook_box = locate_template( 'widgets/facebook-like-box/fb-like-box.php', TRUE, TRUE ); 
  174.  
  175.  
  176.