Advertisement
Guest User

psikon help with font two

a guest
Aug 30th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 KB | None | 0 0
  1. <?php
  2. // Start the engine
  3. require_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. load_child_theme_textdomain( 'metro', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'metro' ) );
  6.  
  7. // Child theme (do not remove)
  8. define( 'CHILD_THEME_NAME', __( 'Metro Theme', 'metro' ) );
  9. define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/metro/' );
  10.  
  11. // Add Viewport meta tag for mobile browsers
  12. add_action( 'genesis_meta', 'metro_viewport_meta_tag' );
  13. function metro_viewport_meta_tag() {
  14. echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
  15. }
  16.  
  17. // Load Oswald and Lora Google fonts
  18. add_action( 'wp_enqueue_scripts', 'metro_load_google_font' );
  19. function metro_load_google_font() {
  20. wp_enqueue_style( 'google-font', 'http://fonts.googleapis.com/css?family=Oswald:400&#039;, array(), PARENT_THEME_VERSION );
  21. wp_enqueue_style( 'google-font-2', 'http://fonts.googleapis.com/css?family=Lora&#039;, array(), PARENT_THEME_VERSION );
  22.  
  23. }
  24.  
  25. // Add new image sizes
  26. add_image_size( 'home-bottom', 150, 150, TRUE );
  27. add_image_size( 'home-middle', 336, 190, TRUE );
  28. add_image_size( 'home-top', 708, 400, TRUE );
  29.  
  30. // Add support for custom background
  31. add_theme_support( 'custom-background', array( 'wp-head-callback' => '__return_false' ) );
  32.  
  33. // Add support for custom header
  34. add_theme_support( 'genesis-custom-header', array(
  35. 'flex-height' => true,
  36. 'height' => 87,
  37. 'width' => 1080
  38. ) );
  39.  
  40. // Create additional color style options
  41. add_theme_support( 'genesis-style-selector', array(
  42. 'metro-blue' => __( 'Blue', 'metro' ),
  43. 'metro-green' => __( 'Green', 'metro' ),
  44. 'metro-orange' => __( 'Orange', 'metro' ),
  45. 'metro-pink' => __( 'Pink', 'metro' ),
  46. 'metro-red' => __( 'Red', 'metro' ),
  47. ) );
  48.  
  49. // Remove the site description
  50. remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
  51.  
  52. // Reposition the secondary navigation
  53. remove_action( 'genesis_after_header', 'genesis_do_subnav' );
  54. add_action( 'genesis_before', 'genesis_do_subnav' );
  55.  
  56. // Adds widget area before the .menu on #subnav
  57. add_filter( 'genesis_do_subnav', 'child_do_subnav_widget', 10, 2 );
  58. function child_do_subnav_widget( $subnav_output, $subnav ){
  59. ob_start();
  60. genesis_widget_area( 'subnav-left', array(
  61. 'before' => '<div class="subnav-left widget-area">',
  62. ) );
  63. $widget_area = ob_get_clean();
  64.  
  65. return str_replace( $subnav, $widget_area . $subnav, $subnav_output );
  66. }
  67.  
  68. // Hooks after-post widget area to single posts
  69. add_action( 'genesis_after_post_content', 'metro_after_post' );
  70. function metro_after_post() {
  71. if ( is_single() && is_active_sidebar( 'after-post' ) ) {
  72. echo '<div class="after-post"><div class="wrap">';
  73. dynamic_sidebar( 'after-post' );
  74. echo '</div></div>';
  75. }
  76. }
  77.  
  78. // Modify comments header text in comments
  79. add_filter( 'genesis_title_comments', 'metro_title_comments' );
  80. function metro_title_comments() {
  81. $title = '<h3><span class="comments-title">' . __( 'Comments', 'metro' ) . '</span></h3>';
  82. return $title;
  83. }
  84.  
  85. // Modify the speak your mind text
  86. add_filter( 'genesis_comment_form_args', 'metro_comment_form_args' );
  87. function metro_comment_form_args($args) {
  88. $args['title_reply'] = '<span class="comments-title">' . __( 'Speak Your Mind', 'metro' ) . '</span>';
  89. return $args;
  90. }
  91.  
  92. // Add support for 3-column footer widgets
  93. add_theme_support( 'genesis-footer-widgets', 3 );
  94.  
  95. // Reposition the footer widgets
  96. remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
  97. add_action( 'genesis_after', 'genesis_footer_widget_areas' );
  98.  
  99. // Reposition the footer
  100. remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
  101. remove_action( 'genesis_footer', 'genesis_do_footer' );
  102. remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
  103. add_action( 'genesis_after', 'genesis_footer_markup_open', 11 );
  104. add_action( 'genesis_after', 'genesis_do_footer', 12 );
  105. add_action( 'genesis_after', 'genesis_footer_markup_close', 13 );
  106.  
  107. // Add span class to widget headlines
  108. add_filter( 'widget_title', 'metro_widget_title' );
  109. function metro_widget_title( $title ){
  110. if( $title )
  111. return sprintf('<span class="widget-headline">%s</span>', $title );
  112. }
  113.  
  114. // Load Backstretch script and prepare images for loading
  115. add_action( 'wp_enqueue_scripts', 'metro_enqueue_scripts' );
  116. function metro_enqueue_scripts() {
  117.  
  118. // Load scripts only if custom background is being used
  119. if ( ! get_background_image() )
  120. return;
  121.  
  122. wp_enqueue_script( 'metro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
  123. wp_enqueue_script( 'metro-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'metro-backstretch' ), '1.0.0' );
  124.  
  125. wp_localize_script( 'metro-backstretch-set', 'BackStretchImg', array( 'src' => get_background_image() ) );
  126.  
  127. }
  128.  
  129. // Register widget areas
  130. genesis_register_sidebar( array(
  131. 'id' => 'subnav-left',
  132. 'name' => __( 'Subnav - Left', 'metro' ),
  133. 'description' => __( 'This is the left side of the subnav section.', 'metro' ),
  134. ) );
  135. genesis_register_sidebar( array(
  136. 'id' => 'home-top',
  137. 'name' => __( 'Home - Top', 'metro' ),
  138. 'description' => __( 'This is the top section of the homepage.', 'metro' ),
  139. ) );
  140. genesis_register_sidebar( array(
  141. 'id' => 'home-middle-left',
  142. 'name' => __( 'Home - Middle Left', 'metro' ),
  143. 'description' => __( 'This is the middle left section of the homepage.', 'metro' ),
  144. ) );
  145. genesis_register_sidebar( array(
  146. 'id' => 'home-middle-right',
  147. 'name' => __( 'Home - Middle Right', 'metro' ),
  148. 'description' => __( 'This is the middle right section of the homepage.', 'metro' ),
  149. ) );
  150. genesis_register_sidebar( array(
  151. 'id' => 'home-bottom',
  152. 'name' => __( 'Home - Bottom', 'metro' ),
  153. 'description' => __( 'This is the bottom section of the homepage.', 'metro' ),
  154. ) );
  155. genesis_register_sidebar( array(
  156. 'id' => 'after-post',
  157. 'name' => __( 'After Post', 'metro' ),
  158. 'description' => __( 'This is the after post section.', 'metro' ),
  159. ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement