How to add custom search form

Posted in: Newspaper
Post count: 13

Hi,

I am looking to add two search forms in theme : Where search terms include custom taxonomy and Advance Custom Fields.

Just to specify i am looking to add datepicker in Form where my users are going to search post with date range vai ACF date fields.

QUERY:
=====

1. How would i add bootstrap css and js to child theme?
For this what i did yet

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 1001);
function theme_enqueue_styles() {
wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/bootstrap/css/bootstrap.css' );

wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/bootstrap/css/bootstrap-datepicker.css' );
wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/bootstrap/css/bootstrap-datepicker.min.css' );
wp_enqueue_style('td-theme', get_template_directory_uri() . '/style.css', '', TD_THEME_VERSION . 'c' , 'all' );
wp_enqueue_style('td-theme-child', get_stylesheet_directory_uri() . '/style.css', array('td-theme'), TD_THEME_VERSION . 'c', 'all' );

}
function theme_js() {

global $wp_scripts;

wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/bootstrap/js/jquery.min.js' );

wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/bootstrap/js/moment.min.js' );

wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js' );

wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/bootstrap/js/bootstrap-datepicker.min.js' );
wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/bootstrap/js/bootstrap-datetimepicker.*js' );
}

add_action( 'wp_enqueue_scripts', 'theme_js');

But above code didn’t let me add datepicker or its not working !

2. Is there any way i could add custom search form in via td-api-plugin ?
So if i am able to create custom search form , how would i be able to custom created search template.

Please suggest.

Post count: 20688

Hi,

Maybe you could consider using a plugin, there are custom search plugins which have many advanced options for search customization that you could use. Such as some of these maybe
http://www.wpbeginner.com/showcase/12-wordpress-search-plugins-to-improve-your-site-search/
https://winningwp.com/best-wordpress-search-plugins/

Thanks

Post count: 13

Thanks Simion,

But Query 1..could you please check what am i doing wrong …

Post count: 20688
Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.