• 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

Adding slider via function and hooks

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 › General Discussion › Adding slider via function and hooks

This topic is: not resolved

Tagged: actions, functions, hooks, slider, soliloquy

  • This topic has 3 replies, 2 voices, and was last updated 8 years, 11 months ago by Genesis Developer.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 10, 2014 at 9:53 am #99515
    river-bum
    Member

    Hello -
    I am struggling with something that seems like it should be pretty simple. Using the Soliloquy Lite slider, I want to automatically insert the slider for each page using the post ID.

    This code obviously isn't working, but maybe it will explain what I'm trying to do better:

    add_action( 'genesis_before_content', 'slider');
    $postid = url_to_postid( $url );
    function slider() {
    	soliloquy( '. $postid .' ); 
    }

    For Soliloquy, each page would have a unique image slider. The template tag might look like this:

    if ( function_exists( 'soliloquy' ) ) { soliloquy( '11' ); }

    Does this make sense? Can anybody help a newbie? Thanks a bunch!

    http://www.gregseitz.com/artbenchtrail/benches/somerset/
    April 10, 2014 at 10:04 am #99517
    Genesis Developer
    Member

    Try this one

    add_action( 'genesis_before_content', 'slider');
    function slider() {
          global $post;
    	soliloquy( $post->ID ); 
    }

    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    April 10, 2014 at 10:10 am #99519
    river-bum
    Member

    It worked!

    Very grateful for the help. Thank you!

    April 10, 2014 at 10:11 am #99521
    Genesis Developer
    Member

    You are welcome


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ 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