Home › Forums › Pro Support › How to get the template part working with WPSP? › Reply To: How to get the template part working with WPSP?
August 20, 2018 at 4:50 am
#5692
Participant
Hi Tom!
I’m sorry for late replying. I’ve been out of office for a while.
I was testing again according your suggest but I get the same results: It works if I search for gender or for age but not for both. I’ve tried also with OR instead AND and I get the same result: All the posts, not only those with terms ‘femenino’ or ‘infantil’.
I’ve tried this code in taxonomy.php
if(isset($gender) && !isset($age)){
$custom_settings = array(
'taxonomy' => 'gender',
'tax_term' => $gender,
);
echo '<div class="locutorxs">';
wpsp_display( 2993, $custom_settings );
echo '</div>';
};
if(!isset($gender) && isset($age)){
$custom_settings = array(
'taxonomy' => 'age',
'tax_term' => $age,
);
echo '<div class="locutorxs">';
wpsp_display( 2993, $custom_settings );
echo '</div>';
};
if (isset($gender) && isset($age)) {
$custom_settings = array(
'post_type' => 'locuciones',
'tax_query' => array(
'relation' => 'AND', //Also tested with OR
array(
'taxonomy' => 'gender',
'field' => 'slug',
'terms' => &gender //Also tested with 'femenino'
),
array(
'taxonomy' => 'age',
'field' => 'slug',
'terms' => &age //Also tested with 'infantil'
),
)
);
echo '<div class="locutorxs">';
/*while ( have_posts() ) : the_post();
get_template_part( 'contido', get_post_format() ); //Working but without WPSP
endwhile;*/
echo '<div class="locutorxs">';
wpsp_display( 2993, $custom_settings ); //Not working
echo '</div>';
echo '</div>';
}
As I comment in code, I tested it without WPSP (i.e., with WP loop) and it works, so it seems is an issue in WPSP. Any kind of incompatibility with Search & Filter plugin.
Can you think of any way to fix it?
Thanks in advance!