How can I show random posts on my wordpress homepage?

1 Answer

Answer :

Yes you can change recent posts on default WordPress homepage to random posts without using a plugin. You just need to add a code to your active theme's functions.php file. If you are using a child theme you have to change the functions.php file in child theme only. As you are using a premium theme most probably there must be a child theme on it. Add the below code to child theme's functions.php add_action('pre_get_posts','alter_query'); function alter_query($query){ if ($query->is_main_query() &&  is_home()) $query->set('orderby', 'rand'); //Set the order to random } Now your wordpress will start showing random posts instead of recent posts. Remember if you are using caching on homepage then the posts may not change on every pageloads.

Related questions

Description : How can I edit my homepage on WordPress?

Last Answer : answer:Can you link to what you want to edit? Some details would be nice. Wordpress is modular. It takes a lot of stuff to build the frontpage. header.php post.php sidebar.php footer.php style.css

Description : Who else just loves the random little quotes on the homepage?

Last Answer : I noticed them too, they’re pretty amazing. I think my favorite is “Well, we don’t think you’re having a bad hair day”.

Description : WordPress Posts aren't adjusting to images?

Last Answer : answer:Looks like it’s because your images are “float“ed. Try: .post {clear: both;} to have the posts under previous images.

Description : Can you import wordpress posts from an entire site into delicious?

Last Answer : answer:

Description : Is there a wordpress plugin that would allow me to put random quotes on my website (like ask-public has?)

Last Answer : answer:I don’t believe the ask-public quotes are random, in the sense they are auto generated. They are manually generated, but randomly displayed. Similar to what a wordpress random quote widget might provide.

Description : How can I use a wordpress theme to show my own language characters?

Last Answer : Sorry I have no experience with wordpress. What I can tell you is that you want to change your character set (charset) to one that fits your needs (the set you are currently using doesn't ... suited one. See this wiki entry on the replacement character � and this wiki entry on character encoding.

Description : When I try to put my scrollbar in my tumblelog, none of my posts show up. What am I doing wrong?

Last Answer : View the source Here

Description : Is there a way to have Feedburner only show the most recent blog posts it retrieves from my blog as opposed to all of them?

Last Answer : answer:found my answer through the FeedBurner Help Center: http://www.google.com/support/feedburner/bin/answer.py?answer[equal]79626 basically I would take the Code: http://myblogname.blogspot.com ... the following format: Code: http://myblogname.blogspot.com/feeds/posts/default?max-results[equal]3

Description : Website homepage and admin panel error message?

Last Answer : Technical difficulties means that they are having problems at the server end. The problem is not you, it is them. Be patient.

Description : How can I restore my google homepage?

Last Answer : IF your computer is Windows driven, this is what Microsoft suggests.IF this doesn’t help, go to your favorite search engine & search for ”restore google homepage” & look for the answer that actually fits your situation.

Description : Can you describe everything on Bing's homepage from November 18,2015?

Last Answer : Why is the link I posted giving me today’s? Let me try again: http://www.bing.com/ Same thing. How do I get it to post yesterdays?

Description : Is Google's url shrinker under "more", on the homepage? If not where is it?

Last Answer : answer:Google's url shorterner appears to be one that is no longer maintained. Note that the branding and entire style of the page is many iterations old. Google has had many tools that they've shut down. ... people even know about it. Plus, it doesn't seem to be as popular as bitly or tinyurl.

Description : What do you find is missing from your Google homepage?

Last Answer : It has all been put under the Apps icon. Clicking on it will bring up links to some of the more popular applications and then a “more” option for the ones that are not on the short list.

Description : YAHOO homepage keeps making statements like World's worst this and World's best that - annoying, eh?

Last Answer : Really? You see this? Every time, all the news I see is about how some celebrity wore a really horrid dress in public. Seriously, I’m not being funny, I don’t know how many times that really has been one of their headlines. :/

Description : Is there an alternative to Google as a homepage?

Last Answer : Are you actually looking for a new search engine rather than a new home page?

Description : What do you use for your web browser homepage?

Last Answer : Google News.

Description : Are "Help" Give us Feedback" etc. missing from the homepage of Google?

Last Answer : From what I see, the direct links to those features have been removed from the homepage. Apparently the route to those links is now More > Even more > Contact us, which takes you to this page. I'd say ... want you see a page full of their products as you scan to the bottom for the Contact us link.

Description : New Facebook layout question: Is there a way to display birthdays on the homepage?

Last Answer : I just got on Facebook a minute ago, and the layout has changed again. They made it easier to get to the most recent stories, gave the option of turning off notifications for close friends, and now ... pretty sure they just adjusted it so we would be able to see them. Perhaps you should look again?

Description : What would make a great computer internet homepage?

Last Answer : HuffPost, CNN, MSNBC, Science Daily, National Geographic….lol.

Description : Why does my tumblr homepage always end up going to a page called "Zynga RewardVille"?

Last Answer : answer:This is what I’m seeing: http://i53.tinypic.com/2emlaib.png I don’t see anything about Zynga. It could very well be you’ve got a bug on your side.

Description : What would cause not every computer getting a website's new homepage? See detail?

Last Answer : answer:EDIT: My original answer was about Domain Propagation, I did not read the question carefully and now I think It sounds like a cache issue. Computers store web pages, so if you ask for the same page ... Provideer ( ISP ) of the viewer's site. If that is the problem, it should disappear soon.

Description : How often do you visit the homepage of your favorite useful websites?

Last Answer : Never on sites like google but daily to sites like Fluther. It depends on the site.

Description : What's your homepage set at? Do you change it?

Last Answer : When I first got my computer 6 years ago, MSN was my IP & it was set for the home page. I’ve just always kept it because I like it. It’s very informative & has a lot of different topic sections to go to. I’ll always keep it.

Description : What would you cut from the http://Tastyr.com homepage?

Last Answer : answer:I would remove some—if not all—of the actual reviews from the homepage. That content takes up a lot of space and is better suited to a detail page, a couple clicks away from the homepage. Also, the logo is too similar to Flickr. You should have a more distinct brand identity.

Description : What's your homepage?

Last Answer : www.ask-public.com Would you really expect anything different? ^_^

Description : What's Your Homepage?

Last Answer : Ask-public.com, of Course!

Description : Is there a cheat site where you can find out what the next Apple homepage will be?

Last Answer : answer:…....what? “moves mouse over to Flag as…”

Description : Have you ever seen one of your own photos on the Flickr homepage?

Last Answer : answer:Only on the “recently added” page. I always seem to get the most hits right after I’ve uploaded. P.S. : I love flickr!

Description : I am looking to update the flash on our homepage. Any suggestions?

Last Answer : answer:Well the road animation isn't terrible quality-wise but it is long and doesn't exactly do much for the user since it is just a laundry list of adjectives you ascribe to the company. It might be a ... loss to find a developer, drop me a private message and I may be able to help you find one.

Description : yahoo homepage

Last Answer : Need Answer

Description : how do I uninstall ask.com as my homepage

Last Answer : Similar question has been answered: http://answers.answerspal.com/1183/googlr-chromes-browser-has-been-changed-com-how-change-back .

Description : i want google for homepage ?

Last Answer : how to make Google my homepage

Description : How can I set a homepage on IE for Windows 8?

Last Answer : To change your home page. Make sure you've closed all open tabs, then open internet Explorer for the desktop. Tap or click Tools, and then tap or click Internet

Description : How do I set a default homepage?

Last Answer : Read this quick how-to and learn how to set your browser's home page to your favorite ... The popup window will open up with the default option of General.

Description : "Homepage" word is associated with: a) Operating Systems b) Web Pages c) Word Processing d) None of These

Last Answer : b) Web Pages

Description : What is considered while creating a front page of the website or homepage? a. References of other websites b. A brief elaboration about the company c. Logos portraying the number of awards won by the web designer d. None of the above

Last Answer : d. None of the above

Description : The first page of a website is called the _____: a) Homepage b) Index c) Java Script d) Bookmark e) Intro Page

Last Answer : a) Homepage

Description : The first page of a Web site is called the....... 1) Homepage 2) Index 3) java Script 4) Book Mark

Last Answer : 1) Homepage

Description : What is an organisation’s introductory web page called? (1) Portal (2) Vortal (3) Homepage (4) Web site

Last Answer : Web site

Description : Who are the six people who show up under your facebook. Are they who you communicate with most or just random?

Last Answer : answer:Lots of theories some people say it's the people who visit your profile the most, but I think they're just being paranoid. The reason I think that is that everyone wants a method of figuring out ... how they choose those 6 people, and I don't think we'll ever really know until they do.

Description : Facebook: friends that show up on your profile page (left side), does it mean anything or is it random?

Last Answer : Your chat is located bottom right , on the left top you see a group of people , those are the people who are on chat or have the chat line open . They should be just the people on your friends list .

Description : How can I get more visitors in my wordpress blog?

Last Answer : Share it on social media. But don’t spam people.

Description : When upgraded from appsrv to wamp, wordpress single pages css gone, why?

Last Answer : answer:Check your source that's generated, I would imagine the path to your stylesheet is coming out as a relative path for some reason so it's not picking up correctly when the path is longer. ... Address are correct (Settings -> General), along with your theme settings (Appearance -> Themes).

Description : How do I link wav. audio files and a wav. audio player to a free wordpress.com site?

Last Answer : I’m not a wordpress expert, but it is their code on their website and I don’t think you can add code to wordpress pages.

Description : Why does my wordpress structure keep failing?

Last Answer : answer:404 is pretty unambiguous, something is wrong with your link URL for books (in your example). Some guesses 1) If you're using relative links () then you may not be starting where ... /categoryies/thiscategory/ A link to your site would probably tell a lot more, but maybe start with those?

Description : Admin on wordpress went blank, why?

Last Answer : answer:Have you looked for PHP errors? Your host probably has a way to check the PHP error logs, it may be files on the server or they may have something in their admin panel. If there's a ... , but always good to double check and might be a different user depending on how you did the install.

Description : Wordpress: why does actions bar disappear on public site?

Last Answer : answer:Do you have a link? WordPress puts a margin on the html element to make room for the bar, and then drops the bar at the end of your footer with fixed position. It only carries a ... initial guess. Barring that, make sure you're using wp_footer in your footer template to close everything out.

Description : What's the best social sharing plugin for WordPress?

Last Answer : I’ve never found one that really made me happy. :( I tend to just write social media in by hand.

Description : What is a good plugin for statistics for a Wordpress based web site?

Last Answer : What data do you want?

Description : How to make a javascript code between shortcodes showing in Wordpress?

Last Answer : answer:My guess is that Wordpress is stripping the javascript out. I found this: http://codex.wordpress.org/Using_Javascript