Forums › Forums › Search & Filter Pro › Query in filter
Tagged: query, query_posts, results
- This topic has 3 replies, 2 voices, and was last updated 8 years, 2 months ago by Trevor.
-
Anonymous(Private) September 16, 2016 at 12:49 am #58351
Hi,
Sorry for my english, i speak spanish.
When i’m displaying the results in a archive like search.php o archive.php the plugin doesn’t affect the query and doesn’t work.
For fix this i have to create other file named filter.php and add the line search_filter_id in query_posts manually, but is not the idea.
I use a custom theme created for me and i use the default loop:
<?php if (have_posts()) : while (have_posts()) : the_post(); get_template_part('loop/loop', 'place'); endwhile; ?>
Regards
Trevor(Private) September 16, 2016 at 9:58 am #58365Ola Matias
Can you look and see if the template (or any file it includes) has an args array like this:
$args = array( 'posts_per_page' => 6, 'cat' => 5, 'order' => 'ASC', 'search_filter_id' => '435' ); query_posts( $args );
Notice the last line? It is a special line for Search & Filter and is the ID of the search form.
Anonymous(Private) September 16, 2016 at 4:16 pm #58445Hi Trevor,
I need the filter work with archive.php but when i add the ‘search_filter_id’ args, the archive.php only work with sf and doesn’t work with others querys.
I try to create a file named filter.php with the query, but i have two filters (one in my home and other in the archive) and i can’t create an array in the args with the id of search_filter_id
You understend me ?
Regards,P.S.: Is ‘Hola’ with ‘H’ 😛 hahahaha
Trevor(Private) September 16, 2016 at 4:58 pm #58460Oops – Hola
Have a look at this thread, maybe it will help?
https://support.searchandfilter.com/forums/topic/sf-not-affecting-query_posts-function-how/
-
AuthorPosts