Number of Featured Posts in Slider

Home Forums Modern Number of Featured Posts in Slider

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

    Sharkster4000
    Participant

    Number of Featured Posts in Slider

    Resolved

    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    Hi there,

    is there a way I can set (i.e. limit) the amount of featured posts in the homepage post slider (other than reducing the amount of featured posts themselves)?

    Right not it seems to be at 6 posts, but I would like to reduce that. Thanks for your answer in advance!

    Best regards,
    Martin

    #21533

    Oliver Juhas
    Keymaster

    Hi Martin,

    Please use this code (and modify it to your needs) in your child theme‘s functions.php file to modify the number of featured posts in slideshow:

    function child_theme_ns_featured_posts_get_posts_args( $args ) {
    	$args['numberposts'] = 6;
    	return $args;
    }
    add_filter( 'wmhook_modern_ns_featured_posts_get_posts_args', 'child_theme_ns_featured_posts_get_posts_args' );

    Best regards,

    Oliver Juhas
    WebMan Design

    #21579

    Sharkster4000
    Participant

    Hi Oliver,

    unfortunately, I didn’t get this to work. Is there something in the code I need to edit/customize to fit my site (other than the number of posts to show)?

    Best regards,
    Martin

    #21581

    Oliver Juhas
    Keymaster

    Hi Martin,

    I’ve tried the code and it works perfectly fine for me.

    Please make sure you have put the code into your child theme‘s functions.php file, and also make sure you child theme is activated.

    Best regards,

    Oliver Juhas
    WebMan Design

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

You must be logged in to reply to this topic.