Advertisement
srikat

Untitled

Apr 20th, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.31 KB | None | 0 0
  1. <?php
  2. //* Start the engine
  3. include_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. //* Child theme (do not remove)
  6. define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
  7. define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );
  8. define( 'CHILD_THEME_VERSION', '2.0.1' );
  9.  
  10. //* Enqueue Lato Google font
  11. // add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
  12. function genesis_sample_google_fonts() {
  13.     wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,700', array(), CHILD_THEME_VERSION );
  14. }
  15.  
  16. //* Add HTML5 markup structure
  17. add_theme_support( 'html5' );
  18.  
  19. //* Add viewport meta tag for mobile browsers
  20. add_theme_support( 'genesis-responsive-viewport' );
  21.  
  22. //* Add support for custom background
  23. add_theme_support( 'custom-background' );
  24.  
  25. //* Add support for 3-column footer widgets
  26. // add_theme_support( 'genesis-footer-widgets', 3 );
  27.  
  28.  
  29.  
  30. genesis_register_sidebar( array(
  31.     'id'            => 'top-bar',
  32.     'name'          => 'Top Bar',
  33.     'description'   => 'This is the top horizontal section'
  34. ) );
  35.  
  36. genesis_register_sidebar( array(
  37.     'id'            => 'home-slider-left',
  38.     'name'          => 'Home Slider Left',
  39.     'description'   => 'This is the left slider section'
  40. ) );
  41. genesis_register_sidebar( array(
  42.     'id'            => 'home-slider-right',
  43.     'name'          => 'Home Slider Right',
  44.     'description'   => 'This is the right slider section'
  45. ) );
  46.  
  47. genesis_register_sidebar( array(
  48.     'id'            => 'home-middle',
  49.     'name'          => 'Home Middle',
  50.     'description'   => 'This is the home middle content section'
  51. ) );
  52.  
  53. add_action( 'genesis_before_header', 'top_bar' );
  54. function top_bar() {
  55.  
  56.     genesis_widget_area( 'top-bar', array(
  57.         'before'    => '<div class="top-bar widget-area"><div class="wrap">',
  58.         'after'     => '</div></div>',
  59.     ) );
  60.  
  61. }
  62.  
  63. //* Customize search form input box text
  64. add_filter( 'genesis_search_text', 'sp_search_text' );
  65. function sp_search_text( $text ) {
  66.     return esc_attr( 'Keywords...' );
  67. }
  68.  
  69. //* Customize search form input button text
  70. add_filter( 'genesis_search_button_text', 'sp_search_button_text' );
  71. function sp_search_button_text( $text ) {
  72.     return esc_attr( 'Search' );
  73. }
  74.  
  75. //* Enqueue Google fonts
  76. add_action( 'wp_enqueue_scripts', 'sp_load_google_fonts' );
  77. function sp_load_google_fonts() {
  78.     wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700|Fauna+One', array(), CHILD_THEME_VERSION );
  79. }
  80.  
  81. /**
  82.  * Filter the genesis_seo_site_title function to use an image for the logo instead of a background image
  83.  *
  84.  * The genesis_seo_site_title function is located in genesis/lib/structure/header.php
  85.  * @link http://blackhillswebworks.com/?p=4144
  86.  *
  87.  */
  88.  
  89. add_filter( 'genesis_seo_title', 'bhww_filter_genesis_seo_site_title', 10, 2 );
  90.  
  91. function bhww_filter_genesis_seo_site_title( $title, $inside ){
  92.  
  93.     $child_inside = sprintf( '<a href="%s" title="%s"><img src="'. get_stylesheet_directory_uri() .'/images/logo.jpg" title="%s" alt="%s"/></a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), esc_attr( get_bloginfo( 'name' ) ), esc_attr( get_bloginfo( 'name' ) ) );
  94.  
  95.     $title = str_replace( $inside, $child_inside, $title );
  96.  
  97.     return $title;
  98.  
  99. }
  100.  
  101. //* Remove the site description
  102. remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
  103.  
  104. add_action( 'genesis_after_header', 'sk_home_slider' );
  105. function sk_home_slider() {
  106.  
  107.     if ( ! is_front_page() ) {
  108.         return;
  109.     }
  110.  
  111.     echo '<div class="home-slider"><div class="wrap">';
  112.         genesis_widget_area( 'home-slider-left', array(
  113.             'before'    => '<div class="home-slider-left widget-area two-thirds first">',
  114.             'after'     => '</div>',
  115.         ) );
  116.  
  117.         genesis_widget_area( 'home-slider-right', array(
  118.             'before'    => '<div class="home-slider-right widget-area one-third">',
  119.             'after'     => '</div>',
  120.         ) );
  121.     echo '</div></div>';
  122.  
  123. }
  124.  
  125. add_action( 'get_header', 'sk_home_genesis_meta' );
  126. /**
  127.  * Add widget support for homepage. If no widgets active, display the default loop.
  128.  *
  129.  */
  130. function sk_home_genesis_meta() {
  131.  
  132.     if ( is_front_page() && is_active_sidebar( 'home-middle' ) ) {
  133.  
  134.         //* Remove the default Genesis loop
  135.         remove_action( 'genesis_loop', 'genesis_do_loop' );
  136.  
  137.         //* Show home widget area in the Genesis loop
  138.         add_action( 'genesis_loop', 'sk_home_widget_areas' );
  139.  
  140.     }
  141.  
  142. }
  143.  
  144. function sk_home_widget_areas() {
  145.  
  146.     genesis_widget_area( 'home-middle', array(
  147.         'before' => '<div class="home-middle widget-area"><div class="wrap">',
  148.         'after'  => '</div></div>',
  149.     ) );
  150.  
  151.     echo '<div id="blogBox">
  152.        <h4 class="widget-title widgettitle">Our Blog</h4>';
  153.     wprss_display_feed_items( $args = array(
  154.         'links_before' => '<ul>',
  155.         'links_after' => '</ul>',
  156.         'link_before' => '<li>',
  157.         'link_after' => '</li>',
  158.         'limit' => '8'
  159.         ));
  160.     echo '</div>';
  161. }
  162.  
  163. //* Add new image size
  164. add_image_size( 'home-articles-thumb', 100, 100, true );
  165.  
  166. //* Change the footer text
  167. add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
  168. function sp_footer_creds_filter( $creds ) {
  169.     wp_nav_menu( array('menu' => 'Footer Menu 1', 'menu_class' => 'menu genesis-nav-menu' ));
  170.     wp_nav_menu( array('menu' => 'Footer Menu 2', 'menu_class' => 'menu genesis-nav-menu' ));
  171.     $creds = '<div id="copyCont">[footer_copyright] All rights reserved Family Time Magazine<br/>10221 W. Lincoln Hwy.  |  Frankfort, IL 60423  |  Phone: 815.806.8844  |  Fax: 815.806.8855</div>';
  172.     return $creds;
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement