Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //* Start the engine
- include_once( get_template_directory() . '/lib/init.php' );
- //* Child theme (do not remove)
- define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
- define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );
- define( 'CHILD_THEME_VERSION', '2.0.1' );
- //* Enqueue Lato Google font
- // add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
- function genesis_sample_google_fonts() {
- wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,700', array(), CHILD_THEME_VERSION );
- }
- //* Add HTML5 markup structure
- add_theme_support( 'html5' );
- //* Add viewport meta tag for mobile browsers
- add_theme_support( 'genesis-responsive-viewport' );
- //* Add support for custom background
- add_theme_support( 'custom-background' );
- //* Add support for 3-column footer widgets
- // add_theme_support( 'genesis-footer-widgets', 3 );
- genesis_register_sidebar( array(
- 'id' => 'top-bar',
- 'name' => 'Top Bar',
- 'description' => 'This is the top horizontal section'
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-slider-left',
- 'name' => 'Home Slider Left',
- 'description' => 'This is the left slider section'
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-slider-right',
- 'name' => 'Home Slider Right',
- 'description' => 'This is the right slider section'
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle',
- 'name' => 'Home Middle',
- 'description' => 'This is the home middle content section'
- ) );
- add_action( 'genesis_before_header', 'top_bar' );
- function top_bar() {
- genesis_widget_area( 'top-bar', array(
- 'before' => '<div class="top-bar widget-area"><div class="wrap">',
- 'after' => '</div></div>',
- ) );
- }
- //* Customize search form input box text
- add_filter( 'genesis_search_text', 'sp_search_text' );
- function sp_search_text( $text ) {
- return esc_attr( 'Keywords...' );
- }
- //* Customize search form input button text
- add_filter( 'genesis_search_button_text', 'sp_search_button_text' );
- function sp_search_button_text( $text ) {
- return esc_attr( 'Search' );
- }
- //* Enqueue Google fonts
- add_action( 'wp_enqueue_scripts', 'sp_load_google_fonts' );
- function sp_load_google_fonts() {
- wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700|Fauna+One', array(), CHILD_THEME_VERSION );
- }
- /**
- * Filter the genesis_seo_site_title function to use an image for the logo instead of a background image
- *
- * The genesis_seo_site_title function is located in genesis/lib/structure/header.php
- * @link http://blackhillswebworks.com/?p=4144
- *
- */
- add_filter( 'genesis_seo_title', 'bhww_filter_genesis_seo_site_title', 10, 2 );
- function bhww_filter_genesis_seo_site_title( $title, $inside ){
- $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' ) ) );
- $title = str_replace( $inside, $child_inside, $title );
- return $title;
- }
- //* Remove the site description
- remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
- add_action( 'genesis_after_header', 'sk_home_slider' );
- function sk_home_slider() {
- if ( ! is_front_page() ) {
- return;
- }
- echo '<div class="home-slider"><div class="wrap">';
- genesis_widget_area( 'home-slider-left', array(
- 'before' => '<div class="home-slider-left widget-area two-thirds first">',
- 'after' => '</div>',
- ) );
- genesis_widget_area( 'home-slider-right', array(
- 'before' => '<div class="home-slider-right widget-area one-third">',
- 'after' => '</div>',
- ) );
- echo '</div></div>';
- }
- add_action( 'get_header', 'sk_home_genesis_meta' );
- /**
- * Add widget support for homepage. If no widgets active, display the default loop.
- *
- */
- function sk_home_genesis_meta() {
- if ( is_front_page() && is_active_sidebar( 'home-middle' ) ) {
- //* Remove the default Genesis loop
- remove_action( 'genesis_loop', 'genesis_do_loop' );
- //* Show home widget area in the Genesis loop
- add_action( 'genesis_loop', 'sk_home_widget_areas' );
- }
- }
- function sk_home_widget_areas() {
- genesis_widget_area( 'home-middle', array(
- 'before' => '<div class="home-middle widget-area"><div class="wrap">',
- 'after' => '</div></div>',
- ) );
- echo '<div id="blogBox">
- <h4 class="widget-title widgettitle">Our Blog</h4>';
- wprss_display_feed_items( $args = array(
- 'links_before' => '<ul>',
- 'links_after' => '</ul>',
- 'link_before' => '<li>',
- 'link_after' => '</li>',
- 'limit' => '8'
- ));
- echo '</div>';
- }
- //* Add new image size
- add_image_size( 'home-articles-thumb', 100, 100, true );
- //* Change the footer text
- add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
- function sp_footer_creds_filter( $creds ) {
- wp_nav_menu( array('menu' => 'Footer Menu 1', 'menu_class' => 'menu genesis-nav-menu' ));
- wp_nav_menu( array('menu' => 'Footer Menu 2', 'menu_class' => 'menu genesis-nav-menu' ));
- $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>';
- return $creds;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement