• Resolved kbenker

    (@kbenker)


    How do I change the order of posts/pages that show up in the slider? I tried changing the publishing dates and the value in the custom field “feat_slider”, but neither of these things worked.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I found a solution/ workaround to this on the creators website in the comments. I tried what is listed below and it worked for me:

    Ok, I figured out how to order them by date. Go to Plugins > Editor. Select WP Featured Content Slider. Under Plugin Files select “wp-featured-content-slider/content-slider.php”. Scroll down the file content until you come to the custom database query. When you see this line “AND (wposts.post_type = ‘post’ OR wposts.post_type = ‘page’);” highlight the whole line and paste this over it:
    AND (wposts.post_type = ‘post’ OR wposts.post_type = ‘page’)?ORDER BY wposts.post_date DESC“;

    https://www.iwebix.de/featured-content-slider-wordpress-plugin

    Thread Starter kbenker

    (@kbenker)

    That didn’t work for me at first, but I added “AND wposts.post_date < NOW()” before “ORDER BY…” and it worked. Thanks!

    Agree with kbenker, adding post_date is a better move for several reasons, not the least of which is the query could otherwise pick up future dated posts.

    If you’d like to further limit the plugin to show only a set number of posts, add this:

    AND wposts.post_date < NOW()
    ORDER BY wposts.post_date DESC
    LIMIT 0,5″;

    That will put your posts in order by most recent first, and limit the display to the most recent 5. If you want more posts, just change the number five to whatever number you would like to show.

    If you want the oldest posts (not sure why you would, but hey…) then change the DESC to ASC and it will grab the five oldest posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I change the order?’ is closed to new replies.