Search functionality – include date, category and author search

By default, the WordPress search gives an omni-like search facility to WP Posts and Pages that should search any built-in WP content. This can be further extended through a plugin such as Relevanssi. You can though, if I’m understanding you correctly, create a custom search form where you can dictate the fields available to search … Read more

Change default search URL slug in wordpress with Custop Post Type as Search target

Hi Vijay you can try to add post_type as query perameter in you redirect url check following changes in your code. function wp_change_search_url() { if ( is_search() && ! empty( $_GET[‘s’] ) ) { get_query_var( ‘post_type’ ); wp_redirect( home_url( “/search/” ) . urlencode( get_query_var( ‘s’ ) ) . ‘?post_type=” . get_query_var( “post_type’ ) ); exit(); … Read more

Two Search Boxes: one all content, one only titles

It was not so hard and I have solved the problem, so for any one else stuck, just add: if ( isset($_GET[‘search-type’]) == ‘by-ref’ ) { add_filter( ‘posts_search’, ‘__search_by_title_only’, 500, 2 ); } where ‘by-ref’ is set in form as input type=”hidden” name=”search-type” value=”by-ref”

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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)