Last active
April 8, 2018 20:13
-
-
Save braddalton/ce0c1ad405658e6588a726bb63e02111 to your computer and use it in GitHub Desktop.
Replace No Sidebar Pro Front Page Loop With Widget Area https://wp.me/p1lTu0-hs5
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 | |
/** | |
* This file adds the Newsletter page template to the No Sidebar Pro Theme. | |
* | |
* @author StudioPress | |
* @package No Sidebar Pro Theme | |
* @subpackage Customizations | |
*/ | |
//* Enqueue full screen script | |
add_action( 'wp_enqueue_scripts', 'ns_full_screen_script' ); | |
function ns_full_screen_script() { | |
wp_enqueue_script( 'ns-full-screen', get_bloginfo( 'stylesheet_directory' ) . '/js/full-screen.js', array( 'jquery' ), '1.0.0' ); | |
} | |
//* Add newsletter body class to the head | |
add_filter( 'body_class', 'ns_add_body_class' ); | |
function ns_add_body_class( $classes ) { | |
$classes[] = 'ns-newsletter'; | |
return $classes; | |
} | |
//* Hook newsletter widget area after site header | |
add_action( 'genesis_loop', 'ns_newsletter_page_widgets' ); | |
function ns_newsletter_page_widgets() { | |
echo '<div class="full-screen"><div class="widget-area">'; | |
genesis_widget_area( 'newsletter-signup', array( | |
'before' => '<div class="newsletter-signup"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
echo '</div></div>'; | |
} | |
//* Remove the default Genesis loop | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
//* Run the Genesis function | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment