Some search results link to main page instead of post
Some search results link to main page instead of post
Some search results link to main page instead of post
Why are archived pages showing up in searches and able to be accessed?
a more proper way to solve this as pointed in many cases would be : //include search form in header include(locate_template(‘template-header-search.php’)); //include search form in body include(locate_template(‘template-body-search.php’));
Found it thanks for the investigation tips guys! So when it was doing the meta_value search the search term was showing up the meta_key _wp_old_slug‘s meta_value
Default HTML5 Form . Add theme support function wpdocs_after_setup_theme() { add_theme_support( ‘html5’, array( ‘search-form’ ) ); } add_action( ‘after_setup_theme’, ‘wpdocs_after_setup_theme’ ); WordPress will render its built-in HTML5 search form: <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url( “https://wordpress.stackexchange.com/” ); ?>”> <label> <span class=”screen-reader-text”><?php echo _x( ‘Search for:’, ‘label’ ) ?></span> <input type=”search” class=”search-field” placeholder=”<?php echo esc_attr_x( … Read more
What shows in search results is not always controlled by search plugins. You probably need to adjust your theme. Create a child theme, copy search.php from the parent theme into the child theme, and wherever it calls for the_content() replace that with the_excerpt(). Some search plugins may modify this behavior, so you’ll have to do … Read more
single_post_title only works on single posts, so you are okay using this. First thing you could try is changing “true” to “false” to make the title be returned in the title tag you’ve created. If that doesn’t fix it then try adding an h1 as below (which i don’t think you’ll need). SEO is also … Read more
I found a partial solution. When I add this part of code into my search form: <input type=”hidden” name=”post_type[]” value=”my_CPT_name” /> search results contains my CPT (even when ‘exclude_from_search’ is set to ‘true’). Now, I change my pagination code to this: <?php echo paginate_links( array( ‘total’ => $wp_query->max_num_pages, ‘prev_text’ => __(‘ « ‘), ‘next_text’ => … Read more
In your template_search_spec_needs.php, remove the custom query. The parameters in your url (s=&post_type=spec-needs-res) should work with the “normal” loop just fine. So try changing your template_search_spec_needs.php to something like this: <?php while ( have_posts() ) : the_post(); ?> <div class=”span4 spec-needs-list-single”> <div class=”spec-needs-title”><?php the_title(); ?></div> <div><?php the_excerpt(); ?></div> <div class=”plus-btn-spec-needs-cont”><a href=”https://wordpress.stackexchange.com/questions/299191/<?php the_permalink(); ?>”><button class=”plus-btn-spec-needs”>+</button></a></div> </div> … Read more
I’d suggest prohibiting spam users first. But above all, I’m not aware about the performance of the Search Meter plugin. Using free tool like Google Analytics or StatCounter you can verify the searches really occurred or not. Workaround As you have the exact timestamp when the search occurred you can also get the user’s identity, … Read more