Worried I have a funky .htaccess for WP site in light of strange search engine behavior

WordPress responds to requests to a robots.txt with dynamic content if such a file does not exist. That’s one way how the settings from wp-admin/options-privacy.php are used. I recommend to create a static robots.txt, just to make sure no plugin is getting in your way. Sample robots.txt User-agent: * Disallow: /cgi-bin Disallow: /wp-admin Disallow: /wp-includes … Read more

Plugin: Events Manager – Search by start date only

I solved this. First add $args[‘scope’] = $_REQUEST[‘scope’][0]; to the events-list.php under the line: em_locate_template(‘templates/events-search.php’,true); This will stop the search from finding a date range and only search single dates. Then in events-search.php, remove the second box for end-date. then in events manager plugin folder “classes” file em-events.php This is what it should look like … Read more

Display number of posts via adress bar?

If you’re asking to change the number of posts from 10 to something else, you can do one of the following 1) Submit the search query as ?s=key&order=ASC&posts_per_page=5 You can achieve this by adding hidden fields to the form. Just change the number to whatever you want 2) Go to Settings > Reading, change the … Read more

Add search box to page

You can do this using the get_search_form() function. For your custom parameters you can add some hidden fields or you can modify the action attribute value. The following can be considered as your form layout. <form role=”search” method=”get” id=”searchform” action=”<?php echo home_url( “https://wordpress.stackexchange.com/” ); ?>”> <div><label class=”screen-reader-text” for=”s”>Search for:</label> <input type=”text” value=”” name=”s” id=”s” /> … Read more

Custom Search Result Page displaying only 1 result.

Change <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> to <?php if ($allsearch->have_posts()) : ?> <?php while ($allsearch->have_posts()) : $allsearch->the_post(); ?> because otherwise you don’t utilize your custom query. See WP_Query Usage. Also call wp_reset_query(); after the Loop. See wp_reset_query Description. Actually, you don’t need wp_reset_query(); because you use custom WP_Query object … Read more

Force is_search to always TRUE

You can force WordPress to load search.php template when you need it by using the following code: add_filter( ‘template_include’, ‘get_search_template’ ); instead of $q->set( ‘is_search’, true );