pre_get_posts improperly searching revisions
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
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
You will need to first setup a way to get the category of the current page. Maybe something using get_the_category() or similar. Then after you have done that you want to set the selected argument to the ID of the category you want to be selected. Right now you have it set to -1. See … Read more
Go to theme settings in dashboard (Pokemon -> Layout) and set option “Cut content on the Front/Category page” to ON. Update #1 To change the way posts are displayed only on the search page, you can add || is_search() after smt_getOption( ‘layout’, ‘cuttxton’ ) if( smt_getOption( ‘layout’, ‘cuttxton’ ) || is_search() ) But it will … Read more
I was able to accomplish this by installing a plugin called “PHP Snippits” that lets you add code as if you were adding it to functions.php, but through the admin panel. Then I did some reasearch on how to add a custom endpoint and then how to query a user and came up with this. … Read more