Shuffle Posts, or something similar

Home Forums General WordPress Talk Shuffle Posts, or something similar

This topic contains 4 replies, has 2 voices, and was last updated by  Rev. Voodoo 4 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1427

    stickers11
    Member

    I have a portfolio site that uses thumbnails to display posts on the homepage. Because it uses posts, it sorts by latest date created. This is not bad per say, but I would rather the posts show randomly or something similar. I am thinking like you would see in a gallery slider….random images.
    There is probably a simple back-end tweek to the functions.php for this I would imagine? But I don’t know, that’s why I always come here to get the straight dope.
    Thanks, Matt

    #1428

    Rev. Voodoo
    Keymaster

    Yeah actually, that shouldn’t be too hard. A query can be set up on the portfolio template, or from function.php. I just got back from vacation – I should be able to post something to try out soon!

    #1429

    Rev. Voodoo
    Keymaster

    So, are you familiar working with query_posts, get_posts, WP_Query, etc? Just the various ways of modifying a loop and calling posts?
    Basically you can run a query calling to the number of posts you wish or whatever, and then set the orderby parameter to rand.
    http://wordpress.org/support/topic/how-to-display-random-posts-from-a-given-category?replies=6
    http://codex.wordpress.org/Template_Tags/get_posts#Random_posts
    That’s a couple examples showing get_posts and query_posts. It all works, you can run that query before the start of your loop in your template. Or you can run the query from functions.php
    http://vudu.me/376
    There’s my article describing how that might work. Depending how your templates are set up, or if you run the query from functions.php, you would need to conditionalize for is_home or is_front_Page or whatever is appropriate. That should help get you there, if not, lemme know and I can throw up some code examples!

    #1507

    stickers11
    Member

    This is awsome…thank you again. Sorry for the late reply.

    I am not familiar with modifying a loop or calling posts, but you have given me enough to start experimenting on. I’ve yet to not come out successful with your help.

    I really do like  my theme, but don’t like how my “favorite” pieces would continuously get pushed back as I add more posts. Thought about adding a slider, but would take away from the look I have now.

     

     

    #1518

    Rev. Voodoo
    Keymaster

    I’m definitely kind of back and forth with regards to sliders. I have a new theme on my personal blog at http://www.rvoodoo.com with a nifty ‘featured’ section. I’m pretty fond of that right now to be honest. The theme is favepersonal from crowdfavourite – my first premium theme, I wanted a facelift quickly – I’ve been working on my own custom theme for months, and just don’t have the time to put in to it….

    Hopefully you can figure out what you are looking for with regards to your random posts easily. You really can do a lot to display posts in various ways, multiple loops, etc. But it can take a bit of time to learn. My hardest part is conceptualizing…. I can figure out how to code something once I know what I want, but I have a helluva time pinning down exactly what I want a lot of the time.

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

You must be logged in to reply to this topic.