• 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

can't add action to 'genesis_before_content_sidebar_wrap' hook

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 › can't add action to 'genesis_before_content_sidebar_wrap' hook

This topic is: resolved

Tagged: genesis_before_content_sidebar_wrap, is_front_page

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 3 months ago by SRD.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 19, 2016 at 2:52 am #197806
    SRD
    Member

    // Home Page Slider

    Hi. I'd love some help with the following code in our child theme's functions.php, aimed at inserting the 'home' Rev Slider on the front page.

    function mhm_do_home_slider	() {
    	echo do_shortcode('[rev_slider alias="home"]');
    }
    
    if(is_front_page()) {
    	add_action( 'genesis_before_content_sidebar_wrap', 'mhm_do_home_slider' );
    }

    The slider alias is correct, and the front page has been selected in Settings > Reading.

    However, the slider does not appear.

    Help appreciated.

    http://amalfi.madhatmedia.com.au/
    December 19, 2016 at 3:34 am #197807
    Brad Dalton
    Participant
    add_action( 'genesis_before_content_sidebar_wrap', 'mhm_do_home_slider');
    function mhm_do_home_slider() {
    if ( is_front_page()) {
    echo do_shortcode('[rev_slider alias="home"]');
        }
    }
    

    Better using the PHP method with the sliders function call and also test if function_exists otherwise the shortcode will output on the front end without executing if the plugin is inactive. Example


    Tutorials for StudioPress Themes.

    December 19, 2016 at 6:53 am #197820
    SRD
    Member

    Beaut, that example has provided me with:

    function mhm_do_home_slider() {
    	if ( is_front_page() && function_exists( 'putRevSlider' ) ) {
    		putRevSlider("home", "homepage");
    	}
    }
    	
    add_action('genesis_before_content_sidebar_wrap', 'mhm_do_home_slider');

    which works now.

    Thank you.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘can't add action to 'genesis_before_content_sidebar_wrap' hook’ 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