Skip to content

Instantly share code, notes, and snippets.

View braddalton's full-sized avatar

Brad Dalton braddalton

View GitHub Profile
add_action('genesis_after_header', 'display_after_header_image');
function display_after_header_image(){
echo '<div class="header-image"><img src="http://yourdomain.com/images/header.png" alt="header logo" /></div>';
}
genesis_register_sidebar( array(
'id' => 'before-content',
'name' => __( 'WP Sites Custom Widget', 'crystal' ),
'description' => __( 'This is the before-content section.', 'crystal' ),
) );
add_action( 'genesis_after_header', 'custom_before_content', 9 );
function custom_before_content() {
if ( is_home() && is_active_sidebar( 'before-content' ) ) {
function wpsites_image_before_title() {
if(is_page() )
echo '<div class="header-banner"><img src="http://example.com/url/to/image.jpg" alt="header banner" /></div>';
}
add_action('genesis_before_post_title', 'wpsites_image_before_title');
.page-id-007 #header {
max-width: 980px;
margin: 0 auto;
width: 100%;
height: 149px;
background: url("images/small.png") no-repeat scroll 0 0 transparent;
}
function specific_category_header_image(){
if(is_home())
echo '<div class="home-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>';
elseif(is_category(1) )
echo '<div class="category-one-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>';
function wpsites_add_text_genesis() {
if(is_single())
echo '<div class="text-box">Add Text</div>';
};
add_action('genesis_before_post_content', 'wpsites_add_text_genesis');
genesis_register_sidebar( array(
'id' => 'welcome-text',
'name' => __( 'Welcome Text', 'eleven40' ),
'description' => __( 'This is the welcome text widget.', 'eleven40' ),
) );
function custom_welcome_text() {
if ( is_home() && is_active_sidebar( 'welcome-text' ) ) {
genesis_widget_area( 'welcome-text', array(
function shortcode_below_inner_div() {
if (is_single()) {
echo do_shortcode('[your gravity form shortcode]');
}
};
add_action('genesis_before_content_sidebar_wrap', 'shortcode_below_inner_div');
function wpsites_tile_category_archives() {
if (is_category()) {
echo do_shortcode('[wp-tiles]');
}
};
add_action('genesis_before_content_sidebar_wrap', 'wpsites_tile_category_archives');
@braddalton
braddalton / Add Widget Before Secondary Sidebar Alt
Last active December 15, 2015 11:39
Adds widget before secondary sidebar when using the sidebar - content - sidebar layout.
/** WP Sites Widget Before Secondary Sidebar (Alt) */
genesis_register_sidebar( array(
'id' => 'before-secondary-sidebar',
'name' => 'Before Secondary Sidebar Content',
'description' => 'Displays content before the Secondary (ALT) sidebar.',
) );
add_action( 'genesis_before_sidebar_alt_widget_area', 'wpsites_widget_before_secondary_sidebar' );