Last active
August 29, 2015 14:11
-
-
Save kontikidigital/6c138757a8a0c4c5d9bc to your computer and use it in GitHub Desktop.
Genesis Horizontal Opt-In using eNews Extended plugin
This file contains hidden or 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
/*Display the Opt-In widget in Front Page*/ | |
echo '<div id="opt-in-wrap">'; | |
genesis_widget_area( 'horizontal-opt-in', array( | |
'before' => '<div class="horizontal-opt-in widget-area"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
echo '</div>'; |
This file contains hidden or 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
//* If you use this file you shouldn't update front-page.php and do not use the other functions.php file in this gist | |
//* Register Horizontal Opt-In widget area | |
genesis_register_sidebar( | |
array( | |
'id' => 'horizontal-opt-in', | |
'name' => __( 'Horizontal Opt-In' ), | |
'description' => __( 'This is the widget area for horizontal opt-in form.' ), | |
) ); | |
//* Display Horizontal Opt-In below Header | |
add_action( 'genesis_after_header', 'sk_horizontal_opt_in' ); | |
function sk_horizontal_opt_in() { | |
genesis_widget_area( 'horizontal-opt-in', array( | |
'before' => '<div id="opt-in-wrap"><div class="horizontal-opt-in widget-area"><div class="wrap">', | |
'after' => '</div></div></div>', | |
) ); | |
} |
This file contains hidden or 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
/* Horizontal Opt-in Widget | |
--------------------------------------------- */ | |
//* Register Horizontal Opt-In widget area | |
genesis_register_sidebar( | |
array( | |
'id' => 'horizontal-opt-in', | |
'name' => __( 'Horizontal Opt-In' ), | |
'description' => __( 'This is the widget area for horizontal opt-in form.' ), | |
) ); |
This file contains hidden or 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
/* ## Horizontal Opt-in Form | |
--------------------------------------------- */ | |
.horizontal-opt-in { | |
margin-top: 10px; | |
padding-top: 5px; | |
padding-bottom: 5px; | |
background-color: #F5F5F5; | |
-webkit-transition: all 0.5s ease-in-out; | |
-moz-transition: all 0.5s ease-in-out; | |
-o-transition: all 0.5s ease-in-out; | |
-ms-transition: all 0.5s ease-in-out; | |
transition: all 0.5s ease-in-out; | |
} | |
.enews-widget { | |
color: #555; | |
font-size: 1.0em; | |
letter-spacing: 0.20em; | |
font-weight: 800; | |
} | |
.enews-widget p { | |
float: left; | |
width: 45%; | |
margin-top: 5px; | |
margin-bottom: 0; | |
margin-left: 5%; | |
font-weight: bold; | |
/*text-align: center;*/ | |
text-transform: uppercase; | |
} | |
#subscribe { | |
float: right; | |
width: 45%; | |
margin-right: 5%; | |
} | |
.enews-widget input { | |
float: left; | |
width: 33%; | |
margin-right: 10px; | |
margin-bottom: 0; | |
padding: 6px; | |
border: 1px solid transparent; | |
color: #555; | |
} | |
.enews-widget input[type="submit"] { | |
width: auto; | |
padding: 6px; | |
background-color: #f5c7b8; | |
} | |
.enews-widget input[type="submit"]:hover { | |
color: #fff; | |
background-color: #f0f0f0; | |
} | |
#opt-in-wrap:hover .horizontal-opt-in { | |
background-color: #A48F5F; | |
} | |
#opt-in-wrap:hover .enews-widget { | |
color: #f5f5f5; | |
} | |
#opt-in-wrap:hover .enews-widget input[type="submit"] { | |
background-color: #f5f5f5; | |
color: #A48F5F; | |
-webkit-transition: all 0.5s ease-in-out; | |
-moz-transition: all 0.5s ease-in-out; | |
-o-transition: all 0.5s ease-in-out; | |
-ms-transition: all 0.5s ease-in-out; | |
transition: all 0.5s ease-in-out; | |
} | |
#opt-in-wrap:hover .enews-widget input[type="submit"]:hover { | |
background-color: #f5c7b8; | |
color: #fff; | |
} | |
@media only screen and (max-width: 1200px) { | |
.enews-widget p { | |
font-size: 16px; | |
text-align: left; | |
} | |
.enews-widget input { | |
width: 30%; | |
} | |
} | |
@media only screen and (max-width: 800px) { | |
.horizontal-opt-in { | |
padding: 2% 5% 5% 5%; | |
} | |
.enews-widget p { | |
float: none; | |
width: 100%; | |
margin-bottom: 20px; | |
text-align: center; | |
margin-left: 0; | |
} | |
#subscribe { | |
float: none; | |
width: 100%; | |
} | |
.enews-widget input { | |
width: 100%; | |
margin-bottom: 20px; | |
} | |
.enews-widget input[type="submit"] { | |
float: none; | |
width: 100%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment