I want to filter 2 taxonomies post via shortcode but it doesn't work for logic operator AND
the filter should show post that has the 2 taxonomies in common but also if I choose one taxonomy it shows results like it uses the OR operator instead of AND
For example i have 2 taxonomies
1. tipologia
2. luogo
tipologia = barca-a-vela
luogo = capri
The shortcode is
[wpv-view name='testi-personalizzati-shortcode' wpvtipologiabarcatesto ='barca-a-vela' wpvluogotesti='capri']
if i use this
[wpv-view name='testi-personalizzati-shortcode' wpvtipologiabarcatesto ='' wpvluogotesti='capri']
or this
[wpv-view name='testi-personalizzati-shortcode' wpvtipologiabarcatesto ='barca-a-vela' wpvluogotesti='']
it shows results and it shouldn't
it shows results also
I give you admin access the page to see is:
enlace oculto

Minesh
Colaborador
Idiomas:
Inglés (English )
Zona horaria:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
Actually, when you do not pass anything to the shortcode it will not consider it.
What if you try to use the following shortcode:
[wpv-view name='testi-personalizzati-shortcode' wpvtipologiabarcatesto ='0' wpvluogotesti='capri']
or this
[wpv-view name='testi-personalizzati-shortcode' wpvtipologiabarcatesto ='barca-a-vela' wpvluogotesti='0']
Do you see it works as expected?
Thank you so much!
It works now!!
Sorry...
I noticed that if I only choose the "luogotesti" attribute it doesn't work:
[wpv-view name='testi-personalizzati-shortcode' wpvtipologiabarcatesto ='0' wpvluogotesti='capri'] it should display only posts with wpvluogotesti = capri but NOT
🙁
Can you please share details where exactly you have added the view at what section?
I used this code to build a shortcode that retrieves luogo and imbarcazione and creates the views shortcode
function get_shortcode_testo_personalizzato() {
$output = flrt_selected_filter_terms();
$slug_luogo = $output["luogo"]["values"][0];
$slug_imbarcazione = $output["imbarcazione"]["values"][0];
if (!$slug_luogo) {
$slug_luogo = "0";
}
if (!$slug_imbarcazione) {
$slug_imbarcazione = "0";
}
$output_shortcode = "[wpv-view name='testi-personalizzati-shortcode' wpvtipologiabarcatesto ='$slug_imbarcazione' wpvluogotesti='$slug_luogo']";
//return $output_shortcode;
echo do_shortcode("$output_shortcode");
}
add_shortcode( 'testo-personalizzato', 'get_shortcode_testo_personalizzato' );
I got it but I do not know what values returned by function flrt_selected_filter_terms();.
Do you see every values returned and you assigned is correct? Either I will require admin access details to check your issue or duplicator copy of your site. Please let me know what mode you would prefer.
flrt_selected_filter_terms simply returns slugs.
I want to grant you access
Can you please share details where exactly you have added the view at what section? Please share screenshot and problem URL.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Unfortunately, the admin access details you shared is not working at this end. Could you please send me working admin access details.
I have set the next reply to private which means only you and I have access to it.
I used another type of approach.
My issue is resolved now. Thank you!