-
-
Save cdils/dba41f3520cb30c5a5c0 to your computer and use it in GitHub Desktop.
Customize the home page loop on Utility Pro (see this tutorial -> http://www.carriedils.com/custom-front-page-loop/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //remove this entire line | |
// Full width layout | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); | |
// Remove standard loop and replace with loop showing Posts, not Page content. | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
// We've already removed the loop. We don't want to add this custom one in. | |
// add_action ( 'genesis_loop', 'utility_pro_front_loop' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //remove this entire line | |
// Display latest posts instead of static page | |
function utility_pro_front_loop() { | |
global $query_args; | |
genesis_custom_loop( wp_parse_args( $query_args, array( | |
'post_type' => 'post', | |
'category_name'=>'news', | |
'paged' => get_query_var( 'page' ) | |
) | |
) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //remove this entire line | |
// Add this widget area in, if a widget is being used in this widget area | |
if ( $home_sidebars['the-widget-id-goes-here'] ) { | |
add_action( 'genesis_after_header', 'your_special_widget' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //remove this entire line | |
// Add a function that calls genesis_widget_area (this outputs your widget area) | |
function your_special_widget() { | |
genesis_widget_area( | |
'the-widget-id-goes-here', | |
array( | |
'before' => '<div class="your-css-class"><div class="wrap">', | |
'after' => '</div></div>', | |
) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //remove this entire line | |
// Remove standard loop and replace with loop showing Posts, not Page content. | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action ( 'genesis_loop', 'utility_pro_front_loop' ); | |
// Display latest posts instead of static page | |
function utility_pro_front_loop() { | |
global $query_args; | |
genesis_custom_loop( wp_parse_args( $query_args, array( 'post_type' => 'post', 'paged' => get_query_var( 'page' ) ) ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.home .site-inner { | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment