• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Swank Theme: Using Genesis Responsive Slider at the top of blog posts

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Swank Theme: Using Genesis Responsive Slider at the top of blog posts

This topic is: resolved

Tagged: slider, swank

  • This topic has 7 replies, 3 voices, and was last updated 8 years, 9 months ago by maru.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • August 15, 2014 at 8:15 pm #119167
    maru
    Member

    Hello,

    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.com
    August 16, 2014 at 3:02 pm #119261
    JanHoek
    Participant

    What 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 #119379
    maru
    Member

    Hello 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 #119383
    JanHoek
    Participant
    add_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 #119388
    maru
    Member

    Do I need to add that code instead of the one I have? Or after?

    August 17, 2014 at 1:39 pm #119395
    maru
    Member

    Ok, 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 #119400
    esueanne
    Member

    Just wanted to tell you your test site is beautiful!

    Sue

    August 17, 2014 at 3:50 pm #119407
    maru
    Member

    Oh thank you Sue!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Swank Theme: Using Genesis Responsive Slider at the top of blog posts’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble