Community Forums › Forums › Archived Forums › Design Tips and Tricks › Swank Theme: Using Genesis Responsive Slider at the top of blog posts
- This topic has 7 replies, 3 voices, and was last updated 11 years, 11 months ago by
maru.
-
AuthorPosts
-
August 15, 2014 at 8:15 pm #119167
maru
MemberHello,
I'm using the Swank Theme and I'm trying to add the Genesis Responsive Slider at the top of my blog posts and still have the sidebar, something like this http://www.kfancydesigns.com. When I try to do this, the slider appears at the bottom of the page and the sidebar disappears.
Here's my site: http://www.fashionyfab.com
http://www.fashionyfab.comAugust 16, 2014 at 3:02 pm #119261JanHoek
ParticipantWhat code did you use to include the slider?
Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.
August 17, 2014 at 12:35 pm #119379maru
MemberHello Jan,
I added the following code to my functions.php file:
//* Hook before post widget area before post content
add_action( 'genesis_before_post_content', 'sp_before_post_widget' );
function sp_before_post_widget() {
if ( is_singular( 'post' ) )
genesis_widget_area( 'before-post', array(
'before' => '<div class="before-post widget-area">',
'after' => '</div>',
) );
}But then what do I have to do?
August 17, 2014 at 12:49 pm #119383JanHoek
Participantadd_action( ‘genesis_before_entry_content’, ‘slider_before_post_widget’ ); function slider_before_post_widget() { if ( is_singular( ‘post’ ) ) genesis_widget_area( 'post-slider', array( 'before' => '<div class="home-slider widget-area">', 'after' => '</div>', ) ); } //* Register widget areas genesis_register_widget_area( array( 'id' => 'post-slider', 'name' => __( 'Home - Slider', 'child' ), 'description' => __( 'This is the Slider section of the Home page.', child' ), ) );And than put the slider in the widget-area
Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.
August 17, 2014 at 1:01 pm #119388maru
MemberDo I need to add that code instead of the one I have? Or after?
August 17, 2014 at 1:39 pm #119395maru
MemberOk, I got it! Just in case anyone else needs it, the code is like this:
/** Add new widget before entry on homepage in Genesis theme | basicwp.com/add-new-widget-genesis-homepage/ */
genesis_register_sidebar( array(
'id' => 'homepage-feature',
'name' => __( 'Homepage Feature', 'custom' ),
'description' => __( 'This is Homepage feature section', 'custom' ),
) );/** Top Homepage feature section */
add_action( 'genesis_before_entry', 'news_homepage_feature', 9 );
function news_homepage_feature() {
if ( is_home() && is_active_sidebar( 'homepage-feature' ) ) {
echo '<div class="homepage-feature">';
dynamic_sidebar( 'homepage-feature' );
echo '</div><!-- end .homepage-feature -->';
}
}Thank you!
August 17, 2014 at 1:55 pm #119400esueanne
MemberJust wanted to tell you your test site is beautiful!
Sue
August 17, 2014 at 3:50 pm #119407maru
MemberOh thank you Sue!
-
AuthorPosts
- The topic ‘Swank Theme: Using Genesis Responsive Slider at the top of blog posts’ is closed to new replies.