Skip to content

Instantly share code, notes, and snippets.

@webdev1001
Forked from surefirewebserv/add-widget-area.php
Last active August 29, 2015 14:15
Show Gist options
  • Save webdev1001/68dbc0c32e53f2158b17 to your computer and use it in GitHub Desktop.
Save webdev1001/68dbc0c32e53f2158b17 to your computer and use it in GitHub Desktop.
<?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>',
) );
<?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
}
#sfws-optin {
display:none;
}
<?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