• 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

Add Slider Plugin to Homepage

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 › Add Slider Plugin to Homepage

This topic is: not resolved

Tagged: add slider, Author Pro

  • This topic has 6 replies, 2 voices, and was last updated 5 years, 5 months ago by MACROCCS.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 8, 2017 at 1:14 pm #210131
    MACROCCS
    Member

    Hi!

    I am assisting a client with adding a slider plugin to his WordPress site. To add the slider, I need to add a shortcode to the homepage where the slider is to be displayed, but there is no "home" in his Pages list. I believe the dynamic homepage is controlled by the theme, Genesis - Author Pro.
    Can you tell me where to go to insert the shortcode?

    Thank you!
    CV

    http://libertyparkpress.com/
    August 8, 2017 at 1:21 pm #210132
    Brad Dalton
    Participant

    You can hook in the shortcode using echo do_shortcode or better still, the sliders function call using add_action and a conditional tag.

    Here's some code examples you can modify for use with your sliders function call or shortcode.


    Get Help – Book Consultation.

    August 8, 2017 at 1:57 pm #210133
    MACROCCS
    Member

    Thanks so much for the fast response! This has been really helpful!
    I am still struggling with where exactly to put the code. Maybe you can help me? I am in public_html/wp-content/themes/author-pro/front-page.php trying to insert the following code:
    <?php echo do_shortcode('[name_of_shortcode]'); ?>

    I've also tried just
    echo do_shortcode('[name_of_shortcode]');
    inside the existing PHP.

    August 8, 2017 at 2:16 pm #210134
    Brad Dalton
    Participant

    What slider are you using?


    Get Help – Book Consultation.

    August 8, 2017 at 2:19 pm #210135
    MACROCCS
    Member

    WP Responsive Recent Post Slider
    The shortcode is [recent_post_slider] so I was actually using
    echo do_shortcode('[recent_post_slider]');
    when I tried it on the site.

    August 8, 2017 at 2:23 pm #210136
    Brad Dalton
    Participant

    You can add the shortcode to a text widget in the front page 1 widget area and enable shortcodes in widgets

    add_filter( 'widget_text', 'do_shortcode');
    

    or

    Use code in your functions.php file to hook it in after the header.

    add_action( 'genesis_after_header', 'display_slider_header_home' );
    function display_slider_header_home() {
    if ( is_front_page() ) { 
    echo do_shortcode('[recent_post_slider]');
        }
    }
    

    Get Help – Book Consultation.

    August 8, 2017 at 2:34 pm #210137
    MACROCCS
    Member

    That worked! I didn't realize the text widget worked for short codes.

    Thanks so much for all your help!

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and 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