How to get started?

I recommend the following WordPress plugin: https://wordpress.org/plugins/advanced-custom-fields/ This allows you to put custom fields in each post or CPT like the following: Text Textarea Range CheckBox Radio button Select Date Picker Date Time Picker Wysiwyg Editor etc… For the fields FROM STOP,TO STOP,START HOUR and END HOUR you can use: Select and Date Time Picker

why pre_get_posts works fine in post type archive, but not in search result list?

If searching via WordPress ?s=keyword (not WooComm’s Product Search), post_type isn’t set or used, so the following would return false: if( isset($query->query_vars[‘post_type’]) && $query->query_vars[‘post_type’] == ‘product’ ) { You can explore what $query->query_vars contains on your Products page vs your Products Search page by just printing it and killing the page: function my_pre_get_posts( $query ) … Read more

Trying to remove plural ‘s’ from search Query but it’s just removing every letter of the end – what am I doing wrong? Thanks

Try this: function mySearchFilterFunction($query) { if ( !is_admin() && $query->is_main_query() && $query->is_search) { $search_term = $query->get(‘s’); if (substr($search_term, -1) == ‘s’){ $search_term = substr($search_term, 0, -1); } $query->set(‘s’, $search_term); } } add_action( ‘pre_get_posts’, ‘mySearchFilterFunction’);

Search Results No Link

The problem is in this part <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class=”entry-summary”> <div class=”entry”> <?php $content = get_the_content(); $content = strip_tags($content); echo ‘<p>’ . substr($content, 0, 255) . ‘ […] </p>’; ?> <hr class=”post-divider”/> </div> </div> <?php else : ?> You need to add a link … Read more

How to combine two get_users() array?

Edit: to clarify, the answer to How can I merge them together for results? Is that you really can’t, not without a lot of custom SQL and using filters. The complexity of going that route far outweighs any perceived benefits and wouldn’t be very future-proof. I’d recommend using the solution below and putting it all … Read more

How to have search results page sorted by post date

WordPress will order search results by newest post first by default, so if your results are in a different order then it looks like another plugin is affecting them. Have you tried searching with all other plugins disabled? If you’re using Relevanssi, then it won’t order results by date as Relvanssia overrides this with its … Read more

What does wordpress search, search?

yes, WordPress search only searches title or post content. There are a few plugins that extend search to taxonomies, Relevanssi is one. EDIT – The query WordPress produces for default search: SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%test%’) OR (wp_posts.post_content LIKE ‘%test%’))) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post_status=”publish” OR … Read more

Search WooCommerce Products in WordPress

Just extend your search form with a hidden input: (notice the last input field) <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( ‘Search …’, ‘placeholder’ ) ?>” value=”<?php echo get_search_query() ?>” name=”s” title=”<?php echo esc_attr_x( ‘Search for:’, … Read more

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