• Resolved dave_udes

    (@dave_udes)


    Hi,

    I would like to know if it’s possible to have a post in the slider option, while not being visible on the main page?

    What I don’t like, is that my first slide is the same posts that is right under the slider.

    Thanks.

Viewing 1 replies (of 1 total)
  • You don’t really need to hide the first post from the index.

    What you need to do is overwrite the /inc/slider/slider.php file from your child theme and change this code:

    $args = array(
    	'posts_per_page' => $number,
    	'cat' => $cat
    );

    to this code:

    $args = array(
    	'posts_per_page' => $number,
    	'cat' => $cat,
    	'orderby' => 'rand'
    );

    This will display the posts randomly in your slider.
    Another option is to change to the following code, which will show the posts in ascending order, instead of the descending order in which they are shown now:

    $args = array(
    	'posts_per_page' => $number,
    	'cat' => $cat,
    	'orderby' => 'ASC'
    );

Viewing 1 replies (of 1 total)
  • The topic ‘Posts in slider’ is closed to new replies.