Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Nathan Holmes

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Nathan Holmes in reply to:
    Auto Submit when input value changes
    #263863

    Hi Ross,

    I added your code to my test site. The results are the same, it’s submitting the form but the search term is not being stored.
    http://holmestuned-001-site3.itempurl.com/

    Nathan Holmes in reply to:
    Auto Submit when input value changes
    #263523

    Unfortunately, that’s not working. I tried both ways as you mentioned. Adding $(‘.searchandfilter’).submit() does the same with no search term being carried over to the results page.

    Nathan Holmes in reply to:
    Auto Submit when input value changes
    #263519

    No, I’m using an S&F widget. I’ve put together an example site here:http://holmestuned-001-site3.itempurl.com/

    Click on the ‘Custom Search Term’ button to fill the S&F search bar and submit the form. Notice that the search term is not being saved.

    You can manually type into the search box and everything works fine.

    Nathan Holmes in reply to:
    Auto Submit when input value changes
    #263503

    $(‘.searchandfilter’).submit() does successfully submit the form. However, the search term does not carry over to the search template page. It simply returns results as if the search term was empty.

    Nathan Holmes in reply to:
    get_search_query stops working with Relevannsi enabled
    #249236

    Yes, I have it working as expected. Thanks for your help!

    Nathan Holmes in reply to:
    get_search_query stops working with Relevannsi enabled
    #249232

    Okay, now it’s displaying the query.

    So essentially I would just need to replace get_search_query with this code, correct?

    capture

    Nathan Holmes in reply to:
    get_search_query stops working with Relevannsi enabled
    #249228

    I’m testing on my localhost so I’m replacing the id with the correct form id. Here is what it shows now:

    capture

    Nathan Holmes in reply to:
    get_search_query stops working with Relevannsi enabled
    #249214

    It’s showing the following:
    Array
    (
    )

    capture

    Nathan Holmes in reply to:
    get_search_query stops working with Relevannsi enabled
    #249191

    The problem only appears to be happening with S&F search bars. I’ve included a link to a working example below.

    I’ve added an S&F search and a default WP search bar on the page so you can test each one.
    You can use “salt” as your search term.

    http://inyoblog2.azurewebsites.net/blog/

    Nathan Holmes in reply to:
    get_search_query stops working with Relevannsi enabled
    #249127
    
    <!--Display Search & Filter Widget -->
    		<?php if (is_active_sidebar('search-bar')) : ?>
    							<div id="search-bar" role="complementary">
    								<?php dynamic_sidebar('search-bar'); ?>
    								
    							</div>
    						<?php endif; ?>		
    
    		<header id="search-title">
    			
    				<h3 class="page-title">
    					<?php
    						printf(
    							/* translators: %s: query term */
    							esc_html__('Search Results for: %s', 'understrap'),
    							'<span>"' . get_search_query() . '"</span>'
    						);
    						?>
    				</h3>
    			
    		</header><!-- .page-header -->
    
    		<div class="row">
    
    			<!-- Do the left sidebar check and opens the primary div -->
    			<?php get_template_part('global-templates/left-sidebar-check'); ?>
    
    			<main class="site-main" id="main">
    
    				<?php if (have_posts()) : ?>
    
    					<div class="card-columns"> 
    
    					<?php /* Start the Loop */ ?>
    
    					<?php while (have_posts()) : the_post(); ?>
    						<?php
    							//Display search results based on content type. 
    							//To change how different content types are displayed in search, edit the content-search loop template.									
    							get_template_part('loop-templates/content', 'search');
    									
    						?>
    						
    					<?php endwhile; ?>
    
    					</div><!--Card Column-->
    
    				<?php else : ?>
    					<?php
    						/* If the search term does not exist in the current category,
    						   a custom query will be intiated to display other content types that
    						   match the search term.
    					    */
    						if (is_category('videos')) {
    							$custom_query_args = array(
    								'category_name' => 'articles,htg',
    								'posts_per_page' => -1,
    								's' => get_search_query()
    							);
    						} elseif (is_category('articles')) {
    							$custom_query_args = array(
    								'category_name' => 'videos,htg',
    								'posts_per_page' => -1,
    								's' => get_search_query()
    							);
    						} elseif (is_category('htg')) {
    							$custom_query_args = array(
    								'category_name' => 'articles,videos',
    								'posts_per_page' => -1,
    								's' => get_search_query()
    							);
    						} else {
    							$custom_query_args = array(
    								'category_name' => 'articles,videos,htg',
    								'posts_per_page' => -1,
    								's' => get_search_query()
    							);
    						}
    						$custom_query_args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
    
    						$custom_query = new WP_Query($custom_query_args);
    
    						// Output custom query loop
    						if ($custom_query->have_posts()) :
    
    							if (is_category('Videos')) {
    								printf('<h5>Sorry, we don\'t have any videos that match your search. Here is some other content that might interest you.</h5>');
    							} elseif (is_category('Articles')) {
    								printf('<h5>Sorry, we don\'t have any articles that match your search. Here is some other content that might interest you.</h5>');
    							} elseif (is_category('How-To Guides')) {
    								printf('<h5>Sorry, we don\'t have any how-to guides that match your search. Here is some other content that might interest you.</h5>');
    							} ?>
    
    							<div class="card-columns">
    							<!-- Display search results based on the custom query. -->
    							<?php while ($custom_query->have_posts()) : $custom_query->the_post();
    									
    							get_template_part('loop-templates/content', 'search');
    									
    							endwhile;
    							?>
    							</div><!-- Card Columns -->
    
    						<?php else :
    							//If there is nothing that matches the custom query, display not 'found message'.
    							printf('<h1>Nothing at the moment...</h1>');
    
    							printf('<h6>Sorry, we don\'t have any DIY resources that match your search as of now, but we\'re always working hard on creating new content! Head over to our <a href="http://www.inyopools.com/forum">forum</a> to submit a content suggestion, or if you need an answer right away, feel free to chat with one of our pool experts.</h6>');
    
    						endif; ?>
    
    				<?php endif; ?>
    									
    			</main><!-- #main -->
    
Viewing 10 posts - 1 through 10 (of 10 total)