Theme Support Forum

Support Forum for Free and Premium Themes. Premium Theme Forums are Private! Please log in first to see the Premium forums

If you Like the Asteria Lite Theme and want to Keep it free forever Please Rate it on Wordpress.org (It only takes a few seconds)
Viewing 6 posts - 1 through 6 (of 6 total)

Frontpage Recent Posts

Home Forums Free Theme Support Asteria Lite Frontpage Recent Posts

  • #161576

    Anaïs

    Hello,

    Into the block Frontpage Posts, I would like to display random posts, instead of recent posts. Do you know how I can change that and make it possible? Maybe by changing a function?

    Thanks a lot for your help.

    And it’s a very nice theme by the way, congrats 🙂

    #161619

    Jaclyn

    I am kind of having the same issue as you Anais! Except, I have 15 pages of blogs, and the posts seem to be scattered about. I set the preferences to display 6 posts per page, however 7 show up on most pages. Some of them only show 1 or 4 with gaps in-between the galleries. Any idea how to fix this? My site is phxarch.com/blog (specifically speaking about page 10)

    #161972

    Towfiq I.

    administrator

    @Anais open up functions.php and add this:

    set_query_var( 'post_type', 'post' );

    after this:

    set_query_var( 'order_by', 'rand' );

    @Jaclyn Go to Settings> Reading and set the number of posts per page to 6.

    #162683

    Anaïs

    Thank you for your answer Towfiq, but it still doesn’t work. The recent posts are still remaining ordered by their recentness, and not by random, even after I’ve added the query into the functions file as you said.

    Any other idea? Thanks again 🙂

    #162967

    Towfiq I.

    administrator

    replace this:

    set_query_var( 'order_by', 'rand' );

    with:

    set_query_var( 'orderby', 'rand' );

    #162984

    Anaïs

    Thank you so much! It’s working perfectly 🙂

You must be logged in to reply to this topic.