Forums Forums Search & Filter Pro Show results on same page + filters not working

Viewing 10 posts - 11 through 20 (of 39 total)
  • Trevor
    #185505

    It depends what is going on in this part:

    get_template_part( 'template-parts/content', get_post_type() );
    
    Anonymous
    #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
    #185541

    OK, 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/

    Anonymous
    #185545
    This reply has been marked as private.
    Trevor
    #185562

    Not 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
    #185566

    Ok Trevor, thank you!

    I’ll work on this today and have a feedback tomorrow.

    Anonymous
    #185647

    Trevor, 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?

    Trevor
    #185653

    Two forms on the same page will not interact. This is a feature coming in V3.

    Anonymous
    #185702

    Hmm, ok. Any workarounds for now?

    One more thing, the year filter doesn’t seem to be working 🙁

    Trevor
    #185729
    This reply has been marked as private.
Viewing 10 posts - 11 through 20 (of 39 total)