• Resolved ingerjohnsson

    (@ingerjohnsson)


    I use the latest version of your free plugin with Hello Elementor and want the filter to show on my search results page. I’ve added the php shortcode in my search.php file but the filter doesn’t display at all. I’ve tried to add the code on different pages, but it doesn’t appear anywhere on any page I’ve tried it on. I’ve also tried to move around the code snippet within the php page which doesn’t have any effect either. What is wrong? The code on my search page looks like this:

    <?php
    /**
    * The template for displaying search results.
    *
    * @package HelloElementor
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly.
    }
    ?>
    <main class=”site-main” role=”main”>
    <?php if ( apply_filters( ‘hello_elementor_page_title’, true ) ) : ?>
    <header class=”page-header”>
    <h1 class=”entry-title”>
    <?php esc_html_e( ‘Search results for: ‘, ‘hello-elementor’ ); ?>
    <span><?php echo get_search_query(); ?></span>
    </h1>
    </header>
    <?php endif; ?>
    <div class=”page-content”>
    <?php if ( have_posts() ) : ?>
    <?php echo do_shortcode(‘[wpf-filters id=1]’) ?>
    <?php
    while ( have_posts() ) :
    the_post();
    printf( ‘<h2>%s</h2>’, esc_url( get_permalink() ), esc_html( get_the_title() ) );
    the_post_thumbnail();
    the_excerpt();
    endwhile;
    ?>
    <?php else : ?>
    <p><?php esc_html_e( ‘It seems we can\’t find what you\’re looking for.’, ‘hello-elementor’ ); ?></p>
    <?php endif; ?>
    </div>

    <?php wp_link_pages(); ?>
    <?php
    global $wp_query;
    if ( $wp_query->max_num_pages > 1 ) :
    ?>
    <nav class=”pagination” role=”navigation”>
    <?php /* Translators: HTML arrow */ ?>
    <div class=”nav-previous”><?php next_posts_link( sprintf( __( ‘%s older’, ‘hello-elementor’ ), ‘<span class=”meta-nav”>←</span>’ ) ); ?></div>
    <?php /* Translators: HTML arrow */ ?>
    <div class=”nav-next”><?php previous_posts_link( sprintf( __( ‘newer %s’, ‘hello-elementor’ ), ‘<span class=”meta-nav”>→</span>’ ) ); ?></div>
    </nav>
    <?php endif; ?>
    </main>

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Filter doesn’t show at all on site’ is closed to new replies.