Show Campaigns Widget Setting

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26121
    andyc
    Participant

    Hello,
    I am trying to find how to change the settings on the Show Campaigns widget so that I can have it shows random campaigns with each reload of the site. Currently it’s showing the same 4 campaigns each time and I don’t know how to even change those 4. Ideally I can just set it to random. Our “campaigns” are children to be sponsored so we want it to change out each time on the homepage to show a different set of 4 children.
    Thanks

    #26133
    Veena
    Moderator

    Pls modify file framework/functions/campaign-functions.php line no:188-192 from

    
    $loop = new WP_Query(array(
                'post_type' => 'campaign',
                'posts_per_page' => $posts_per_page,
                
            ));
    

    to

    
    $loop = new WP_Query(array(
                'post_type' => 'campaign',
                'posts_per_page' => $posts_per_page,
                'orderby' => 'rand',
    	    'order'   => 'DESC',
                
            ));
    

    And see if it helps.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Peak Theme Support’ is closed to new topics and replies.