Forums › Forums › Search & Filter Pro › Custom Taxonomy Checkboxes not changing after first selection
Tagged: custom taxonomy, V3
- This topic has 3 replies, 2 voices, and was last updated 4 years, 2 months ago by Trevor.
-
Anonymous(Private) September 7, 2020 at 10:33 am #258588
Hi,
I have a site using Genesis Recipe Pro theme. I have a custom loop, that loops through a custom post type. This post type also has a custom taxonomy.
Everything works fine, until I try and filter by that taxonomy. The initial selection works. The query updates… But then, if I try and select any other checkbox, or unselect the chosen selection, it refreshes the page (correctly) but doesn’t change anything, including the checkbox still being selected. It is happening in 2 separate places:
https://sunsetsewaneed.wpengine.com/equipment-resources
https://sunsetsewaneed.wpengine.com/ingredients/Note that it works fine within the main WP archive loop using the WP categories taxonomy:
https://sunsetsewaneed.wpengine.com/food-2/
I have tried disabling all plugins. There is no caching. The form is added via a sidebar widget.
Here is my code:
$_terms = get_terms( array('product_category') ); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $term_slug = $term->slug; $_posts = new WP_Query( array( 'post_type' => 'product_resources', 'search_filter_id' => 2406, 'posts_per_page' => 12, 'paged' => $paged )); if( $_posts->have_posts() ) : echo '<div class="flexbox">'; while ( $_posts->have_posts() ) : $_posts->the_post(); ?> <div class="flexbox-column"> <div class="fourty-width"> <a target="_blank" href="<?php the_field('affiliate_link');?>"><img src="<?php the_field('product_image');?>"></a> </div> <div class="sixty width"> <h2 class="entry-title"><a href="<?php the_field('affiliate_link');?>"><?php the_title(); ?></a></h2> <p><?php the_field('product_description');?></p> <a href="<?php the_field('affiliate_link');?>" class="affiliate-link" target="_blank">Get It</a> </div> </div> <?php endwhile; $total_pages = $_posts->max_num_pages; if ($total_pages > 1){ $current_page = $_posts->query_vars['paged']; echo '<div class="pagination">'; if(strpos($_SERVER['REQUEST_URI'], '_sft_resource_category') !== false) { echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', 'format' => '&sf_paged=%#%', 'current' => max( 1, $current_page ), 'total' => $total_pages, 'prev_text' => __('« prev'), 'next_text' => __('next »'), )); } else { echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', 'format' => '?sf_paged=%#%', 'current' => max( 1, $current_page ), 'total' => $total_pages, 'prev_text' => __('« prev'), 'next_text' => __('next »'), )); } echo '</div>'; } wp_reset_postdata(); echo '</div>'; endif;
Anonymous(Private) September 7, 2020 at 1:28 pm #258618Thanks for the reply.
The only reason I have 2 is because I need the filters to display differently on mobile and desktop.
On desktop, I need it as checkboxes. On mobile, I want it to be a dropdown. So I added 2 of the same filters, and hid the one that wasn’t needed on mobile.
Is there no way to do that?
-
AuthorPosts