Custom Search not working
Custom Search not working
Custom Search not working
Found out how to do it, I added the following in content.php. I added the second elseif statement and simple put the word Document in there before it displays the title of the page. if ( is_single() ) { the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ ); } elseif (get_post_type() == ‘attachment’ ) { the_title( ‘<h1 class=”entry-title”>Document: <a … Read more
Change search to outpout category name instead of Post type name
Search & Replace trailing strings
Add Search Form to Dropdown menu
Add a new input to the form, the name is key, you can easily access query vars that match a paremeter supporter by WP_Query using the function get_query_var. For example, you could try to generate an URL like this: http://example.com/?s=test&tag=5-personas,4-personas And with get_query_var(tag), you get the values, and the you create a custom WP_Query using … Read more
WordPress WP_Query Array Custom search via taxonomies
Try adding the return as well in the else{}, like this: function template_chooser($template) { global $wp_query; $post_type = get_query_var(‘post_type’); if( $wp_query->is_search && $post_type == ‘product’ ) { return locate_template(‘archive-products.php’); } else { $args = array_merge( $wp_query->query, array( ‘post_type’ => ‘post’ ) ); query_posts( $args ); return locate_template(‘archive-products.php’); } return $template; } add_filter(‘template_include’, ‘template_chooser’); Haven’t tested.
It looks to me like you’re trying to achieve a filtering mechanism, is that right? – by which users can see a list of products which match the set of criteria they give in the drop-downs. If that is the case, and although I haven’t any experience of doing this precise thing myself, a plugin … Read more
Help with WordPress search