You can do this several different ways. Need to know how you are passing the 1 custom field in your current shortcode.
It seems like you might be doing it like this:
[your_short_code price="how_are_you_setting_this"]
if this is the case then you can just add more attributes like this:
[your_short_code price="how_are_you_setting_this" next_field="set_this_field"]
// From your code above with adjustments.
public function listings( $atts ) {
global $post;
// You can add on to the default atts.
$atts = shortcode_atts(
[
'orderby' => 'date',
'order' => 'asc',
'number' => '20',
'price' => '',
'next_field' =>'',
],
$atts
);
// Not exactly sure what you are trying to do here.
$query_args = [
'post_type' => $post->post_type,
'post_status' => 'publish',
'meta_key' => '_al_listing_price',
'orderby' => 'meta_value',
'meta_value' => $atts['price'],
'order' => $atts['order'],
'posts_per_page' => $atts['number'],
];
return $this->listing_loop( $query_args, $atts, 'listings' );
}
Another way of doing it is like this:
// notice that the attribute fields has multiple fields separated by commas.
[your_short_code fields="how_are_you_setting_this,set_next_field,and_set_next"]
If you go with the separated commas then in your shortcode on the php side you will need to do as follows:
// From your code above with adjustments.
public function listings( $atts ) {
global $post;
// You can add on to the default atts.
$atts = shortcode_atts(
[
'orderby' => 'date',
'order' => 'asc',
'number' => '20',
'fields' => '',
],
$atts
);
// This will make an array out of your comma separated fields.
$fields = explode( ',', $atts['fields'] );
// Not exactly sure what you are trying to do here.
$query_args = [
'post_type' => $post->post_type,
'post_status' => 'publish',
'meta_key' => '_al_listing_price',
'orderby' => 'meta_value',
'meta_value' => $atts['price'],
'order' => $atts['order'],
'posts_per_page' => $atts['number'],
];
return $this->listing_loop( $query_args, $atts, 'listings' );
}
Hope this helps you.