This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

adding sliders to posts

  • Creator
    Topic
  • #7802
    chrisski
    Participant

    How can we add individual sliders to posts? the only option currently allows for 1 slider for ALL posts… but we would like to define slider and add them to a post individually… when we add to the page – it will only be shown in the “content” area – but we want it to display like a featured slider – similar to what we can setup for pages…

    the goal is to have a slider that we build for each post and to have it show full width / featured – then below left is article / right is widget column.

    Can we achieve this w/ a custom field? other option? thank you.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #7808
    Jason Bobich
    Keymaster

    There’s no feature in the theme for this.

    You’d have to rig up something custom, like possibly hooking to the feature area from your Child theme’s functions.php. There’s a function themeblvd_slider('your_slider_id') you can use to display sliders.

    // Enable featured area for single posts w/ID's 1, 2, 3
    function my_frontend_config( $config ){
        if( is_single( array( 1, 2, 3 ) ) )
            $config['featured'][] = 'my_featured_content';
        return $config;
    }
    add_filter( 'themeblvd_frontend_config', 'my_frontend_config' );
     
    // Your content to display
    function my_featured(){
        if( is_single( '1' ) )
            themeblvd_slider('slider_1');
    	else if( is_single( '2' ) )
    		themeblvd_slider('slider_2');
    	else if( is_single( '3' ) )
    		themeblvd_slider('slider_3');
    	// etc ...
    }
    add_action('themeblvd_featured_single', 'my_featured');

    … You could possibly setup that by pulling a custom field, as well, to make it more dynamic, opposed to manually checking for each post.

    // Enable featured area for single posts when custom field "whatever" is not empty
    function my_frontend_config( $config ){
        if( is_single() && get_post_meta( get_the_id(), 'whatever', true ) )
            $config['featured'][] = 'my_featured_content';
        return $config;
    }
    add_filter( 'themeblvd_frontend_config', 'my_frontend_config' );
    
    // Your content to display
    function my_featured(){
        $slider_id = get_post_meta( get_the_id(), 'whatever', true );
        if( is_single() && $slider_id )
            themeblvd_slider($slider_id);
    }
    add_action('themeblvd_featured_single', 'my_featured');

    ============

    http://dev.themeblvd.com/tutorial/hooking-to-the-featured-area/

    http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page

    http://codex.wordpress.org/Function_Reference/get_post_meta

Viewing 1 replies (of 1 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.