This creates a widget area site-wide. The widget title is the left floating element and the widget text is the right floating element. I use a general .cta-button inside the widget text for the button.
Created
February 28, 2014 22:22
-
-
Save bawright/9281254 to your computer and use it in GitHub Desktop.
Genesis - Site Callout w/ button
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
| <?php | |
| //* Do NOT include the opening php tag | |
| //* Hook the SITE CALLOUT WIDGET after the header | |
| add_action( 'genesis_after_header', 'odg_callout' ); | |
| function odg_callout() { | |
| printf( '<div %s>', genesis_attr( 'callout' ) ); | |
| genesis_structural_wrap( 'callout' ); | |
| printf( '<div %s>', genesis_attr( 'wrap' ) ); | |
| genesis_widget_area( 'site-callout' ); | |
| echo '</div>'; | |
| genesis_structural_wrap( 'callout', 'close' ); | |
| echo '</div>'; | |
| } | |
| //* Register the SITE CALLOUT WIDGET | |
| genesis_register_sidebar( array( | |
| 'id' => 'site-callout', | |
| 'name' => __( 'Site Callout', 'themename' ), | |
| 'description' => __( 'This is the site callout at the top of the site.', 'themename' ), | |
| ) ); |
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
| .callout { | |
| background-color: #f5f5f5; | |
| border-bottom: 1px solid #eee; | |
| padding: 30px 0; | |
| } | |
| .callout .widget { | |
| margin-bottom: 0; | |
| } | |
| .callout .widget-title { | |
| color: #0067ac; | |
| font-style: italic; | |
| font-weight: 500; | |
| float: left; | |
| width: 75%; | |
| font-size: 30px; | |
| font-weight: 300; | |
| line-height: 1.6; | |
| margin-bottom: 0; | |
| } | |
| .callout p { | |
| float: right; | |
| width: 24%; | |
| text-align: right; | |
| margin-bottom: 0; | |
| } | |
| @media only screen and (max-width: 1023px) { | |
| .callout .widget-title, | |
| .callout p { | |
| float: none; | |
| width: 100%; | |
| } | |
| .callout .widget-title { | |
| margin-bottom: 20px; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment