Last active
April 16, 2019 14:22
-
-
Save surefirewebserv/363bb260f633ba1e6c91 to your computer and use it in GitHub Desktop.
Regsiter New Widget Area
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 | |
// Don't include the PHP tag | |
genesis_widget_area( 'optin', array( | |
'before' => '<div id="sfws-optin" class="sfws-optin widget-area"><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 | |
// Don't inlude the PHP snippet above | |
add_action ('wp_head', 'sfws_add_pretty_photo'); | |
function sfws_add_pretty_photo() { | |
if ( ! (is_home() || is_front_page() ) ) { | |
return; | |
} | |
// Scripts | |
wp_register_script( 'sfws-prettyPhoto-script', get_bloginfo( 'stylesheet_directory' ) . '/js/prettyPhoto.js', array( 'jquery' ), '1.0.0' ); | |
wp_enqueue_script('sfws-prettyPhoto-script'); | |
//Styles | |
wp_register_style( 'sfws-prettyPhoto-style', get_bloginfo( 'stylesheet_directory' ) . '/css/prettyPhoto.css'); | |
wp_enqueue_style('sfws-prettyPhoto-style'); | |
?> | |
<script type="text/javascript" charset="utf-8"> | |
jQuery(document).ready(function(){ | |
jQuery("a[rel^='prettyPhoto']").prettyPhoto({ | |
social_tools: false, | |
theme: 'facebook' | |
}); | |
}); | |
</script> | |
<?php | |
} |
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
#sfws-optin { | |
display:none; | |
} |
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 | |
// Don't inlude the PHP snippet above | |
genesis_register_sidebar( array( | |
'id' => 'optin', | |
'name' => __( 'Email Optin Widget', 'anytheme' ), | |
'description' => __( 'This will hold your email form. Maybe even popup in a lightbox.', 'anytheme' ), | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment