Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez DavidPeralvarez/functions.php Secret
Created Jan 8, 2020

Embed
What would you like to do?
Cómo crear nuevas áreas de widgets
<?php
/**
* Child Theme customizations
*/
// Register a new widget area
genesis_register_sidebar( [
'id' => 'before-entry',
'name' => esc_html__( 'Before Entry', 'genesis-sample' ),
'description' => esc_html__( 'This widget area is placed before post.', 'genesis-sample' )
] );
// Display the widget area
add_action( 'genesis_before_entry', 'genesis_sample_before_post_widget' );
function genesis_sample_before_post_widget(){
if( is_single() ):
genesis_widget_area( 'before-entry', [
'before' => '<div class="before-entry widget-area">',
'after' => '</div>'
]);
endif;
}
/* Before Entry
--------------------------------------------- */
.before-entry {
margin-bottom: 30px;
}
/* Before entry: Widget Text */
.before-entry .widget_text {
padding: 20px;
background-color: #63bdc9;
}
.before-entry .widget_text .textwidget a {
color: white;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.