Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.48 KB | None | 0 0
  1. <?php
  2. //* Start the engine
  3. include_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. //* Setup Theme
  6. include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );
  7.  
  8. //* Set Localization (do not remove)
  9. load_child_theme_textdomain( 'parallax', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'parallax' ) );
  10.  
  11. //* Add Image upload to WordPress Theme Customizer
  12. add_action( 'customize_register', 'parallax_customizer' );
  13. function parallax_customizer(){
  14.  
  15. require_once( get_stylesheet_directory() . '/lib/customize.php' );
  16.  
  17. }
  18.  
  19. //* Include Section Image CSS
  20. include_once( get_stylesheet_directory() . '/lib/output.php' );
  21.  
  22. //* Child theme (do not remove)
  23. define( 'CHILD_THEME_NAME', 'Parallax Pro Theme' );
  24. define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/parallax/' );
  25. define( 'CHILD_THEME_VERSION', '1.1' );
  26.  
  27. //* Enqueue scripts and styles
  28. add_action( 'wp_enqueue_scripts', 'parallax_enqueue_scripts_styles' );
  29. function parallax_enqueue_scripts_styles() {
  30.  
  31. wp_enqueue_script( 'parallax-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
  32.  
  33. wp_enqueue_style( 'dashicons' );
  34. wp_enqueue_style( 'parallax-google-fonts', '//fonts.googleapis.com/css?family=Montserrat|Sorts+Mill+Goudy', array(), CHILD_THEME_VERSION );
  35.  
  36. }
  37.  
  38. //* Add HTML5 markup structure
  39. add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );
  40.  
  41. //* Add viewport meta tag for mobile browsers
  42. add_theme_support( 'genesis-responsive-viewport' );
  43.  
  44. //* Add support for 3-column footer widgets
  45. add_theme_support( 'genesis-footer-widgets', 4 );
  46.  
  47. //* Reposition the primary navigation menu
  48. remove_action( 'genesis_after_header', 'genesis_do_nav' );
  49. add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' );
  50.  
  51. //* Reposition the secondary navigation menu
  52. remove_action( 'genesis_after_header', 'genesis_do_subnav' );
  53. add_action( 'genesis_footer', 'genesis_do_subnav', 7 );
  54.  
  55. //* Reduce the secondary navigation menu to one level depth
  56. add_filter( 'wp_nav_menu_args', 'parallax_secondary_menu_args' );
  57. function parallax_secondary_menu_args( $args ){
  58.  
  59. if( 'secondary' != $args['theme_location'] )
  60. return $args;
  61.  
  62. $args['depth'] = 1;
  63. return $args;
  64.  
  65. }
  66.  
  67. //* Unregister layout settings
  68. genesis_unregister_layout( 'content-sidebar-sidebar' );
  69. genesis_unregister_layout( 'sidebar-content-sidebar' );
  70. genesis_unregister_layout( 'sidebar-sidebar-content' );
  71.  
  72. //* Add support for additional color styles
  73. add_theme_support( 'genesis-style-selector', array(
  74. 'parallax-pro-blue' => __( 'Parallax Pro Blue', 'parallax' ),
  75. 'parallax-pro-green' => __( 'Parallax Pro Green', 'parallax' ),
  76. 'parallax-pro-orange' => __( 'Parallax Pro Orange', 'parallax' ),
  77. 'parallax-pro-pink' => __( 'Parallax Pro Pink', 'parallax' ),
  78. ) );
  79.  
  80. //* Unregister secondary sidebar
  81. unregister_sidebar( 'sidebar-alt' );
  82.  
  83. //* Add support for custom header
  84. add_theme_support( 'custom-header', array(
  85. 'width' => 360,
  86. 'height' => 70,
  87. 'header-selector' => '.site-title a',
  88. 'header-text' => false,
  89. ) );
  90.  
  91. //* Add support for structural wraps
  92. add_theme_support( 'genesis-structural-wraps', array(
  93. 'header',
  94. 'nav',
  95. 'subnav',
  96. 'footer-widgets',
  97. 'footer',
  98. ) );
  99.  
  100. //* Hook after post widget after the entry content
  101. add_action( 'genesis_after_entry', 'parallax_after_entry', 5 );
  102. function parallax_after_entry() {
  103.  
  104. if ( is_singular( 'post' ) )
  105. genesis_widget_area( 'after-entry', array(
  106. 'before' => '<div class="after-entry widget-area">',
  107. 'after' => '</div>',
  108. ) );
  109.  
  110. }
  111.  
  112. //* Modify the size of the Gravatar in the author box
  113. add_filter( 'genesis_author_box_gravatar_size', 'parallax_author_box_gravatar' );
  114. function parallax_author_box_gravatar( $size ) {
  115.  
  116. return 176;
  117.  
  118. }
  119.  
  120. //* Modify the size of the Gravatar in the entry comments
  121. add_filter( 'genesis_comment_list_args', 'parallax_comments_gravatar' );
  122. function parallax_comments_gravatar( $args ) {
  123.  
  124. $args['avatar_size'] = 120;
  125.  
  126. return $args;
  127.  
  128. }
  129.  
  130. //* Register widget areas
  131. genesis_register_sidebar( array(
  132. 'id' => 'home-section-1',
  133. 'name' => __( 'Home Section 1', 'parallax' ),
  134. 'description' => __( 'This is the home section 1 section.', 'parallax' ),
  135. ) );
  136. genesis_register_sidebar( array(
  137. 'id' => 'home-section-2',
  138. 'name' => __( 'Home Section 2', 'parallax' ),
  139. 'description' => __( 'This is the home section 2 section.', 'parallax' ),
  140. ) );
  141. genesis_register_sidebar( array(
  142. 'id' => 'home-section-3',
  143. 'name' => __( 'Home Section 3', 'parallax' ),
  144. 'description' => __( 'This is the home section 3 section.', 'parallax' ),
  145. ) );
  146. genesis_register_sidebar( array(
  147. 'id' => 'home-section-4',
  148. 'name' => __( 'Home Section 4', 'parallax' ),
  149. 'description' => __( 'This is the home section 4 section.', 'parallax' ),
  150. ) );
  151. genesis_register_sidebar( array(
  152. 'id' => 'home-section-5',
  153. 'name' => __( 'Home Section 5', 'parallax' ),
  154. 'description' => __( 'This is the home section 5 section.', 'parallax' ),
  155. ) );
  156. genesis_register_sidebar( array(
  157. 'id' => 'home-section-6',
  158. 'name' => __( 'Home Section 6', 'parallax' ),
  159. 'description' => __( 'This is the home section 6 section.', 'parallax' ),
  160. ) );
  161. genesis_register_sidebar( array(
  162. 'id' => 'after-entry',
  163. 'name' => __( 'After Entry', 'parallax' ),
  164. 'description' => __( 'This is the after entry widget area.', 'parallax' ),
  165. ) );
  166.  
  167. function mason_script() {
  168. wp_enqueue_script( 'jquery-masonry' );
  169. }
  170. add_action( 'wp_enqueue_scripts', 'mason_script' );
  171.  
  172. // add category and ID in body and post class
  173. function category_id_class($classes) {
  174. global $post;
  175. foreach((get_the_category($post->ID)) as $category)
  176. $classes[] = 'category-' . $category->cat_ID;
  177. return $classes;
  178. }
  179. add_filter('post_class', 'category_id_class');
  180. add_filter('body_class', 'category_id_class');
  181. add_filter( 'genesis_term_intro_text_output', 'do_shortcode' );
  182.  
  183. // Always fresh css includer
  184. add_action( 'wp_enqueue_scripts', 'add_styles' );
  185.  
  186. function add_styles()
  187. {
  188. $css_file = get_stylesheet_directory() . '/custom.css';
  189. wp_enqueue_style( 'css-file', get_stylesheet_directory_uri().'/custom.css', NULL, filemtime($css_file) );
  190. };
  191.  
  192. //* Customize search form input box text
  193. add_filter( 'genesis_search_text', 'sp_search_text' );
  194. function sp_search_text( $text ) {
  195. return esc_attr( 'Search...' );
  196. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement