- This topic has 8 replies, 3 voices, and was last updated 4 years, 9 months ago by David.
-
AuthorPosts
-
June 19, 2019 at 5:24 am #934464Shawn
Hi.
I have a strange issue that’s popped up. I installed Relavanssi to see if that fixed it but the issue persists regardless.
When doing any search it simply shows the blog archive page. No results. No, nothing found.
I can’t figure out what the problem is.My search.php is:
<?php /** * The template for displaying Search Results pages. * * @package GeneratePress */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } get_header(); ?> <div id="primary" <?php generate_do_element_classes( 'content' ); ?>> <main id="main" <?php generate_do_element_classes( 'main' ); ?>> <?php /** * generate_before_main_content hook. * * @since 0.1 */ do_action( 'generate_before_main_content' ); if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"> <?php printf( // WPCS: XSS ok. /* translators: 1: Search query name */ __( 'Search Results for: %s', 'generatepress' ), '<span>' . get_search_query() . '</span>' ); ?> </h1> </header><!-- .page-header --> <?php while ( have_posts() ) : the_post(); get_template_part( 'content', 'search' ); endwhile; /** * generate_after_loop hook. * * @since 2.3 */ do_action( 'generate_after_loop' ); generate_content_nav( 'nav-below' ); else : get_template_part( 'no-results', 'search' ); endif; /** * generate_after_main_content hook. * * @since 0.1 */ do_action( 'generate_after_main_content' ); ?> </main><!-- #main --> </div><!-- #primary --> <?php /** * generate_after_primary_content_area hook. * * @since 2.0 */ do_action( 'generate_after_primary_content_area' ); generate_construct_sidebars(); get_footer();
June 19, 2019 at 6:55 am #934734TomLead DeveloperLead DeveloperHi there,
Can you try deactivating your other plugins to check for potential conflicts?
Is that a custom search.php file? If so, what about it did you change?
Let me know 🙂
June 19, 2019 at 6:58 am #934738ShawnThat’s the standard template. Thought perhaps someone might be able to see anything off in there. I’m not great with PHP.
June 19, 2019 at 7:00 am #934742TomLead DeveloperLead DeveloperLooks good to me. I’m assuming something is messing with the query, which usually comes from a buggy plugin/server misconfiguration.
June 19, 2019 at 7:10 am #934758ShawnI tried disabling before and no change then I cleared cache again and tried again and it seems it’s Elementor yet again causing issues.
Thanks for the help. I’ll check in with them and see if they’ll help.
June 19, 2019 at 7:24 am #934773ShawnWhile I wait for them to get back to me, would you happen to know how to add placeholder text into the search bar?
I’m using Snippets so I can add php code.
June 19, 2019 at 7:42 am #934788DavidStaffCustomer SupportHi there,
this article provides the PHP filter function to do that:
https://docs.generatepress.com/article/generate_navigation_search_output/#add-a-placeholder
June 19, 2019 at 10:59 am #934989ShawnThank you. Appreciate the help.
Oh and if anyone else has the search results issue. It was a non-standard post grid. Seems it pulls posts but not search results.
Changing to the standard grid fixed it.Of course then I had the issue of columns being stuck at 50% but an old post on here pointed me at the solution.
June 19, 2019 at 11:47 am #935043DavidStaffCustomer SupportAwesome – glad to hear you got it resolved and that we could be of help
-
AuthorPosts
- You must be logged in to reply to this topic.