Recent Posts slider below posts

Hello.

I’m looking to add a recent posts slider at the bottom of my posts, like this:

Is it possible with the Ethos stack without having to add a shortcode in every post?

Thanks!

Hi @andyvnguyen97,

Thank you for reaching out to us. If you have a shortcode for recent posts slider then you can add the following code in your child theme’s functions.php file to display the slider on every post automatically:

function custom_post_slider() {
		if ( is_single() ) {
  			echo do_shortcode('YOUR SHORTCODE HERE');
		}
}
add_action('x_before_the_content_end', 'custom_post_slider');

Just replace YOUR SHORTCODE HERE with your recent posts slider shortcode in the above code.

Let us know how this goes!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.