php /** * Darling Home Page. * * @package Darling * @link http://restored316designs.com/themes * @author Restored 316 Designs * @copyright Copyright (c) 2015, Restored 316 Designs * @license GPL-2.0+ */ //* Add widget support for homepage. If no widgets active, display the default loop. add_action( 'genesis_meta', 'darling_front_page_genesis_meta' ); function darling_front_page_genesis_meta() { if ( is_active_sidebar( 'home-top-slider' ) || is_active_sidebar( 'home-top-left' ) || is_active_sidebar( 'home-top-right' ) || is_active_sidebar( 'home-flexible' ) || is_active_sidebar( 'home-featured' ) ) { //* Add body class add_filter( 'body_class', 'darling_front_page_body_class' ); //* Force full width content layout add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); //* Remove Genesis Loop (remove // on next line to remove posts from bottom of home page) //remove_action( 'genesis_loop', 'genesis_do_loop' ); } } //* Add category body class to the head function darling_front_page_body_class( $classes ) { $classes[] = 'darling-home category'; return $classes; } //* Hook welcome widget area after site header add_action( 'genesis_before_content', 'darling_welcome_widget_area' ); function darling_welcome_widget_area() { if( !is_paged()) { genesis_widget_area( 'home-top-slider', array( 'before' => '
', 'after' => '
', ) ); if ( is_active_sidebar( 'home-top-left' ) || is_active_sidebar( 'home-top-right' ) ) { echo '
'; genesis_widget_area( 'home-top-left', array( 'before' => '
', 'after' => '
', ) ); genesis_widget_area( 'home-top-right', array( 'before' => '
', 'after' => '
', ) ); echo '
'; } genesis_widget_area( 'home-flexible', array( 'before' => '
', 'after' => '
', ) ); genesis_widget_area( 'home-featured', array( 'before' => '', ) ); }} //* Do not show Featured image if set in Theme Settings > Content Archives add_filter( 'genesis_pre_get_option_content_archive_thumbnail', '__return_false' ); //* Add the featured image before post title add_action( 'genesis_entry_header', 'darling_archive_grid', 9 ); function darling_archive_grid() { if ( $image = genesis_get_image( 'format=url&size=large-featured' ) ) { printf( '', get_permalink(), $image, the_title_attribute( 'echo=0' ) ); } } //* Force Excerpts add_filter( 'genesis_pre_get_option_content_archive', 'darling_show_excerpts' ); function darling_show_excerpts() { return 'excerpts'; } //* Modify the length of post excerpts add_filter( 'excerpt_length', 'darling_excerpt_length' ); function darling_excerpt_length( $length ) { return 60; // pull first 10 words } //* Modify the Excerpt read more link add_filter('excerpt_more', 'darling_excerpt_more'); function darling_excerpt_more($more) { return '... Read More'; } //* Run the default Genesis loop genesis();