Viewing 1 replies (of 1 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    i understand you would like to have a separate page with the random expired ads? If so then please add the code below in your theme functions.php file.

    
    add_filter( "adverts_list_query", function( $args, $params ) {
        if( isset( $params["order_by"] ) && $params["order_by"] == "rand-expired" ) {
            $args["orderby"] = array( "menu_order" => "DESC", "rand" => "DESC" );
            $args["post_status"] = "expired";
        }
        return $args;
    }, 10, 2 );
    

    Then create page with the following shortcode

    
    [adverts_list order_by="rand-expired"]
    

    If you want to further customize the list you can use other [adverts_list] params listed here https://wpadverts.com/doc/creating-ads-list-adverts_list/ as well.

Viewing 1 replies (of 1 total)
  • The topic ‘show random expired ads on Adverts list’ is closed to new replies.