Apologies for the false alarm. We did manage to find the answers to #1 and #2. Still hoping to get an answer for #3. Oh, and
4. Is there any possibility of putting an excerpt of the description in the ad box when you choose “Display Ads As = List”? Maybe instead of the date?
Hi,
3. you can add the code below in your theme functions.php file, it will replace the location field with categories dropdown
add_filter( 'adverts_form_load', 'search_by_category_form_load_2' );
add_filter( 'adverts_list_query', 'search_by_category_query_2' );
function search_by_category_form_load_2( $form ) {
if( $form['name'] != 'search' ) {
return $form;
}
foreach( $form["field"] as $key => $field ) {
if( $field["name"] == "location" ) {
unset( $form["field"][$key] );
}
}
$form['field'][] = array(
"name" => "advert_category",
"type" => "adverts_field_select",
"order" => 20,
"label" => "",
"max_choices" => 10,
"options" => array(),
"options_callback" => "adverts_taxonomies",
"meta" => array(
"search_group" => "visible",
"search_type" => "half"
)
);
return $form;
}
function search_by_category_query_2( $args ) {
if( ! adverts_request( "advert_category" ) ) {
return $args;
}
$args["tax_query"] = array(
array(
'taxonomy' => 'advert_category',
'field' => 'term_id',
'terms' => adverts_request( "advert_category" ),
),
);
return $args;
}
4. in order to add the excerpt to the [adverts_list] you would need to open file wpadverts/templates/list-item.php and add the additional code there.
Note that if you decide to customize the list-item.php file it is best to create a child template for it so your changes will not be overwritten on WPAdverts update.
The child template you can create as explained here https://wpadverts.com/documentation/child-themes-and-templates/