By default, the latest posts list on the front page gets displayed in reverse chronological order and that is what latest posts is. Can you customize it further?
Can you display random posts on the front page?
Add this small bit of code to your child theme’s functions.php and you can indeed display random posts on your front page.
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 }
6 thoughts on “Show random posts on front page”
Hi,
The developer team handles support for Customizr at https://wordpress.org/support/theme/customizr and for Customizr-Pro at http://presscustomizr.com/support/. Please post your query there with a link to your site.
I already asked and no answer yet for days. How do i make slider into multiple recent post image carousel slides instead of 1 image per slide. Thats all i need help on. Any code snippet or functions code for that?
Hi,
I am afraid it is not possible yet.
Thanks.
How can you override default slider on front page for recent posts carousel instead? Can I use the childifyme plugin for this modification, where and how if so? Thank You for any help tips you can give, or codes….
As there are 21 hover effect applied to the post grid, how can I have different effect on different page when I view the post? I want to write script to change the query and then display the result with my custom post grid but applying the hover effect.
Hi,
The developer team handles support for Customizr at https://wordpress.org/support/theme/customizr and for Customizr-Pro at http://presscustomizr.com/support/. Please post your query there with a link to your site.