Adding slider via function and hooks

Community Forums Forums General Discussion Adding slider via function and hooks

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  genwrock 4 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #99515

    river-bum
    Member
    Post count: 8

    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!

    • This topic was modified 4 months, 3 weeks ago by  river-bum.
    • This topic was modified 4 months, 3 weeks ago by  river-bum.
    http://www.gregseitz.com/artbenchtrail/benches/somerset/
    #99517

    genwrock
    Member
    Post count: 532

    Try this one

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

    My Genesis Child Themes Work | Please Follow Me on Twitter If I’ve helped.

    #99519

    river-bum
    Member
    Post count: 8

    It worked!

    Very grateful for the help. Thank you!

    #99521

    genwrock
    Member
    Post count: 532

    You are welcome


    My Genesis Child Themes Work | Please Follow Me on Twitter If I’ve helped.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.