• Resolved pedrom77

    (@pedrom77)


    Hi,
    I have a problem with this plugin, that is most likely due to wrong installation from my side.
    I installed the plugin and activated it but the search does not show any results based on product tags.
    Then I relaized I need to place the shortcode: [aws_search_form] in the website.
    I am using the shopkeeper woocommerce theme and so the search is not on a page, post or widget. So not sure what to do exactly.
    Replace a code with some other code?
    Please help me with this.
    Thanks

    • This topic was modified 7 years ago by pedrom77.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter pedrom77

    (@pedrom77)

    When I go into my themes templates tehre are two search related templates: Search form and Search results.
    Should I add this shortcode in there?
    This is the search results:
    <?php get_header(); ?>

    <div id=”primary” class=”content-area search-results”>

    <?php if ( have_posts() ) : ?>
    <div class=”row”>
    <div class=”large-9 large-centered columns”>

    <header class=”page-header”>
    <h1 class=”page-title search-results-title”><span class=”top-page-excerpt”><?php printf( __( ‘Search Results for %s’, ‘shopkeeper’ ), ‘<span class=”page-title”>’ . get_search_query() . ‘</span>’ ); ?></span></h1>
    </header><!– .page-header –>

    </div>
    </div>
    <?php endif; ?>

    <?php if ( (isset($shopkeeper_theme_options[‘sidebar_blog_listing’])) && ($shopkeeper_theme_options[‘sidebar_blog_listing’] == “1” ) ) : ?>
    <div class=”row”><div class=”large-9 columns with-sidebar”>
    <?php endif; ?>

    <div id=”content” class=”site-content” role=”main”>

    <?php if ( have_posts() ) : ?>

    <div class=”row”>
    <div class=”large-9 large-centered columns”>

    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php
    /* Include the Post-Format-specific template for the content.
    * If you want to override this in a child theme, then include a file
    * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    */
    ?>

    <div class=”search_result_item”>

    <h1 class=”entry-title-archive”>
    ” class=”thumbnail_archive”>
    <span><?php the_title(); ?></span>

    </h1>

    <div class=”post_meta_archive”><?php shopkeeper_entry_archives(); ?></div>

    </div><!–.search_content–>

    <?php
    //get_template_part( ‘content’, get_post_format() );
    ?>

    <?php endwhile; ?>

    <?php shopkeeper_content_nav( ‘nav-below’ ); ?>

    </div><!– .columns –>
    </div><!– .row –>

    <?php else : ?>

    <?php get_template_part( ‘content’, ‘none’ ); ?>

    <?php endif; ?>

    </div><!– #content –>

    <?php if ( (isset($shopkeeper_theme_options[‘sidebar_blog_listing’])) && ($shopkeeper_theme_options[‘sidebar_blog_listing’] == “1” ) ) : ?>
    </div><!– .columns –>
    <?php endif; ?>

    <?php if ( (isset($shopkeeper_theme_options[‘sidebar_blog_listing’])) && ($shopkeeper_theme_options[‘sidebar_blog_listing’] == “1” ) ) : ?>
    <div class=”large-3 columns”>
    <?php get_sidebar(); ?>
    </div><!– .columns –>
    <?php endif; ?>

    <?php if ( (isset($shopkeeper_theme_options[‘sidebar_blog_listing’])) && ($shopkeeper_theme_options[‘sidebar_blog_listing’] == “1” ) ) : ?>
    </div><!– .row –>
    <?php endif; ?>

    </div><!– #primary –>

    <?php get_footer(); ?>

    And This is the Search Form:

    <form role=”search” method=”get” class=”search-form” action=”<?php echo esc_url( home_url( ‘/’ ) ); ?>”>
    <label class=”screen-reader-text” for=”s”><?php _e( ‘Search for:’, ‘shopkeeper’ ); ?></label>
    <input type=”search” class=”search-field” placeholder=”<?php _e( ‘Search …’, ‘shopkeeper’ ); ?>” value=”<?php echo esc_attr( get_search_query() ); ?>” name=”s”>
    <input type=”submit” class=”search-submit” value=”<?php _e( ‘Search’, ‘shopkeeper’ ); ?>”>
    </form>

    Thanks

    Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    You need to add shortcode to search form template.

    Replace all it content with

    echo do_shortcode( ‘[aws_search_form]’ );

    Hello ILLID,

    Please is there a way to display the search along side my menu items or anywhere in the header part of a website.. the plugin is exactly what I’ve been looking for and that seem to be my only problem. Thanks.

    Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Yes, it is possible you can use php function

    echo do_shortcode( ‘[aws_search_form]’ );

    to place search form anywhere you want.

    Or you can use build-in AWS widget ( if you have in your theme widget area where you want to place search form ).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Newbie question: where do I have to add the shortcode?’ is closed to new replies.