• Resolved rafafallo

    (@rafafallo)


    I love Themelia clean appearance, but I need to include a slider below the header to add some news. There are a few plugins for creating sliders, but I cannot find a way to include the shortcode on the (main) blog page, nor a way to create a custom blog page where to do that.

    Do you have any idea about how to do that?

    Regards,
    Rafael

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Dario Devcic

    (@dariodev)

    There is an action hook in that place (‘themelia_before_content’), so you could create a custom function which hook into it.
    In following example we have a custom function which will run smartslider3 shortcode, on home page only. You should add it in your child theme functions.php.

    
    function my_custom_slider( $output ) {
    	if ( is_home() ) {
    		$output .= '<div class="grid-100">';
    		$output .= do_shortcode( '[smartslider3 slider=2]' );
    		$output .= '</div>';
    	}
    	echo $output;
    }
    add_action( 'themelia_before_content', 'my_custom_slider' );
    
    Thread Starter rafafallo

    (@rafafallo)

    Thank you very much. I had done a deeper search, and I had found the do_shortcode function and your themelia_before_content hook. But my function is much simpler. Why should I wrap do_shortcode with a <div>?

    Theme Author Dario Devcic

    (@dariodev)

    I’m glad you figured it out on your own. In my example I wrap it in a div with class “grid-100”, because this class adds 15px left/right padding, so the slider will be the same width as the content.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom blog page to add slider’ is closed to new replies.