Random Post In WordPress

Now I learnt in wordperss “How to display random post in home page”. It is very easy. Just we have to add action in “pre_get_posts” tag. I added sourcecode below

function bscode_random_post($query){    
    if($query->is_home && empty($query->query_vars['suppress_filters'])){



Leave a Reply

Your email address will not be published. Required fields are marked *