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

    Hey,

    is it possible to change the Sidebar News Widget so it will display random posts/images of the defined category instead of sorting them by date (which is the actual behavior)?

    Thanks in advance

    Uwe

    http://www.momentslikethis.de

    #55054

    Hey,

    you can open up habitat>framework>theme_widgets>sidebar_news.php and find:

    $additional_loop = new WP_Query("cat=".$cat."&posts_per_page=".$count);

    replace it by:

    $additional_loop = new WP_Query("cat=".$cat."&orderby=rand&posts_per_page=".$count);

    #55055

    Works perfectly, many thanks for the solution :)

    Uwe

    #55056

    Glad that I could help you :)

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

The topic ‘Sidebar News Widget for Random Posts’ is closed to new replies.