Forums › Forums › Search & Filter Pro › Show results on same page + filters not working
Tagged: filters not working, same page results, V3
- This topic has 38 replies, 2 voices, and was last updated 6 years, 4 months ago by Anonymous.
-
Anonymous(Private) August 14, 2018 at 3:05 pm #185509
In this case, content-item.php has a copy of content.php code – I’ll touch these files later, just cloned to keep things in place from the start.
<?php /** * Template part for displaying posts * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package Base_ESTUDIO_CRU */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_singular() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); endif; if ( 'post' === get_post_type() ) : ?> <div class="entry-meta"> <?php estudiocru_base_posted_on(); estudiocru_base_posted_by(); ?> </div><!-- .entry-meta --> <?php endif; ?> </header><!-- .entry-header --> <?php estudiocru_base_post_thumbnail(); ?> <div class="entry-content"> <?php the_content( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'artepensamento' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); wp_link_pages( array( 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'artepensamento' ), 'after' => '</div>', ) ); ?> </div><!-- .entry-content --> <footer class="entry-footer"> <?php estudiocru_base_entry_footer(); ?> </footer><!-- .entry-footer --> </article><!-- #post-<?php the_ID(); ?> -->
Trevor(Private) August 14, 2018 at 4:38 pm #185541OK, we need to make sure where the problem is. Are you able to set up a test page and copy of the filter, but using the shortcode method, as detailed here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
Trevor(Private) August 14, 2018 at 5:11 pm #185562Not necessarily, it simply indicates that either the theme or a plugin is modifying the query after our filter has been applied, but using the shortcode method usually overcomes this, more so if it is the theme doing this, which is what I had initially though was the case.
You can make the results look much like they do using the theme template on a page. To do this, follow the Customising the Results documentation.
When editing the results.php file, you can see the section that displays the post loop (inside the While … if posts). You can replace this with your theme template loop. That might just work.
Anonymous(Private) August 15, 2018 at 1:34 pm #185647Trevor, here I am again.
I made things work with the shortcode options — all good, thanks!
But I think this won’t solve the whole site, because there’s a search field (also created on S&F) placed on header, is it possible to make these two forms interact with the shortcode option?
-
AuthorPosts