CTA & Announcement widget areas – CSS
STYLE.CSS /* Site Wide CTA ------------------------------------------------------ */ .site-wide-cta { background: #fff url(images/border.png) top center repeat-x; background-size: 1200px 1px; border: none; margin: 0 auto; padding: 30px; } .site-wide-cta .enews-widget { color: #333; } .site-wide-cta .enews-widget p { background: transparent; border-right: 1px solid #ae9d78; float: left; font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 300; letter-spacing: 2px; margin-bottom: 0; margin-top: 8px; padding: 20px; text-align: center; text-transform: uppercase; width: 30%; } .site-wide-cta form { float: right; margin: 0 auto; padding: 20px 30px; width: 70%; } .site-wide-cta .enews-widget input { float: left; margin-bottom: 0; margin-right: 10px; padding: 12px; width: 27%; } .site-wide-cta .enews-widget input[type="submit"] { background: #ae9d78; border-color: #ae9d78; color: #fff; margin-right: 0; padding: 12px 34px; width: auto; } .site-wide-cta .enews-widget input[type="submit"]:hover { background: transparent; border-color: #333; color: #333; } @media only screen and (max-width: 1200px) { .announcement-widget .enews-widget p, .site-wide-cta .enews-widget p { border-right: none; float: none; width: 100%; } .announcement-widget .enews-widget input, .site-wide-cta .enews-widget input { width: 27%; } .announcement-widget form, .site-wide-cta form { float: none; width: 100%; } } @media only screen and (max-width: 960px) { .site-wide-cta { width: 100%; } } @media only screen and (max-width: 800px) { .announcement-widget .enews-widget input, .announcement-widget .enews-widget input[type="submit"], .site-wide-cta .enews-widget input, .site-wide-cta .enews-widget input[type="submit"] { float: left; margin: 5px 0; padding: 5px; width: 50%; } .announcement-widget { padding: 0; } }
functions.php
// FUNCTIONS.PHP add_action( 'genesis_before', 'refined_announcement_widget', 8 ); /** * Hooks Announcement Widget. * * @since 1.0.0 */ function refined_announcement_widget() { genesis_widget_area( 'announcement-widget', array( 'before' => '<div class="announcement-widget widget-area"><div class="wrap">', 'after' => '</div></div>', )); } add_action( 'genesis_before_footer', 'refined_site_wide_cta', 8 ); /** * Hooks Site Wide CTA widget after the content. * * @since 1.0.0 */ function refined_site_wide_cta() { if ( ! is_home() ) { genesis_widget_area( 'site-wide-cta', array( 'before' => '<div class="site-wide-cta widget-area"><div class="wrap">', 'after' => '</div></div>', )); } }
lib > widgets.php
// THEME FILE > lib > widgets.php <?php /** * This file adds all the widget spaces to the Refined theme. * * @package Showcase */ // Announcement widget area in navigation. genesis_register_sidebar( array( 'id' => 'announcement-widget', 'name' => __( 'Announcements', 'showcase' ), 'description' => __( 'This is the section at the very top of your site for special announcements.', 'showcase' ), )); // Site Wide CTA widget area. genesis_register_sidebar( array( 'id' => 'site-wide-cta', 'name' => __( 'Site Wide CTA', 'showcase' ), 'description' => __( 'This widget space appears between the 2nd and 3rd home page widget spaces, as well as at the bottom of all other pages.', 'showcase' ), ));