Forums › Forums › Search & Filter Pro › Search error on Roots Theme (now sage)
Tagged: Roots Theme, sage, white page
- This topic has 10 replies, 2 voices, and was last updated 9 years, 7 months ago by Anonymous.
-
Anonymous(Private) April 29, 2015 at 6:52 am #16102
Using a custom template for the search results:
<?php echo do_shortcode('[searchandfilter id="22467"]'); ?> <?php $args = array( 'post_type' => 'post', 'posts_per_page' => 10 ); $query = query_posts($args); ?> <div id="content"> <ul> <?php while (have_posts()) : the_post(); ?> <li> <?php the_title();?> </li> <?php endwhile;?> </ul> </div>
I’ve set the filter to use a specific a page template page-category-results.php
Ross Moderator(Private) April 30, 2015 at 1:12 pm #16231Hi Rory
You must remove:
<?php $args = array( 'post_type' => 'post', 'posts_per_page' => 10 ); $query = query_posts($args); ?>
If you have a query in your template, before you your loop – then it will overwrite the S&F query.
Thanks
Anonymous(Private) April 30, 2015 at 3:44 pm #16258Hey Ross,
I’ve changed it to the following:
<?php echo do_shortcode('[searchandfilter id="22467"]'); ?> <div id="content"> <ul> <?php while (have_posts()) : the_post(); ?> <li> <?php the_title();?> </li> <?php endwhile;?> </ul> </div>
And it still has the same results (white page, returned results). It also doesn’t load the initial posts onto the page either like the demo does
Ross Moderator(Private) April 30, 2015 at 3:50 pm #16262Ahhh a white page? What is the URL of this page? It looks liek you are seeing the Ajax request itself, which likely means there was a javascript error?
Do you have a link I could look at? (I think this may be related to the 4.2 bugs I’m working on now).
Thanks
Anonymous(Private) April 30, 2015 at 3:53 pm #16264Hey Ross,
The page itself is: http://emilyhenderson.wpengine.com/category-results
An example a page url that is returned is: http://emilyhenderson.wpengine.com/?sfid=22467&_sft_category=diy
Ross Moderator(Private) April 30, 2015 at 4:13 pm #16275Ah ok, I see
There seems to be nothing wrong with this then, you just don’t have the regular code for your headers and footers etc 🙂
So what you would need to do is something like the following:
<?php /** * Search Results Template * */ get_header(); ?> <?php echo do_shortcode('[searchandfilter id="22467"]'); ?> <div id="content"> <ul> <?php while (have_posts()) : the_post(); ?> <li> <?php the_title();?> </li> <?php endwhile;?> </ul> </div> <?php get_footer(); ?>
However, you may need to do more than this, depending on your theme – check a regular page template like
page.php
to see the structure of a typical page template in your theme.Thanks
Ross Moderator(Private) April 30, 2015 at 5:47 pm #16280This should be the search page you link to:
http://emilyhenderson.wpengine.com/?sfid=22467
If you want the URL to be different, update the “slug” option under “display results” – and then you can have your search page at something like:
http://emilyhenderson.wpengine.com/my-slug
Thanks
-
AuthorPosts