Last active
August 29, 2015 14:15
-
-
Save arkadiusjonczek/2dae37edecc36a0d3e16 to your computer and use it in GitHub Desktop.
Custom front page in Wordpress using Genesis Framework
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 | |
// front-page.php | |
// set full width layout | |
add_filter ( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); | |
// add section right after header without inner div box for full width | |
add_action( 'genesis_after_header', 'aj_home_double_opt_in' ); | |
function aj_home_double_opt_in() { | |
echo '<div class="feature-box">'; | |
echo '<div class="wrap">'; | |
echo '<div style="width: 100%; height: 200px; background: green;"></div>'; | |
echo '</div>'; | |
echo '</div>'; | |
} | |
// remove Genesis default loop | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
// add a custom loop | |
add_action( 'genesis_loop', 'aj_custom_loop' ); | |
function aj_custom_loop () { | |
echo '<h1>Test</h1>'; | |
echo '<p>Ich komme aus der front-page.php Datei.</p>'; | |
} | |
// run Genesis Framework | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment