Home › Forums › Legacy Support › Support queries › Update Issues › search not working after update to 2.6
- This topic has 5 replies, 2 voices, and was last updated 7 years, 10 months ago by Anshuman Sahu.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
February 24, 2017 at 10:44 am #97231chinolzSpectatorhttps://hakin9.org/ search not working and miss aligned after update to 2.6February 24, 2017 at 10:54 am #97236chinolzSpectatori found out you guys updated the header files. i replaced them and its fine now. One question, where did you locate the search form, i cant find it? i need to customize the search, to only search "course" "wpdmpro" "post" in the old header the code would be something like this: <div id="searchdiv"> <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> <div><label class="screen-reader-text" for="s">Search for:</label> <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" placeholder="<?php _e('Hit enter to search...','vibe'); ?>" /> <input type="hidden" name="post_type[]" value="course" /> <input type="hidden" name="post_type[]" value="wpdmpro" /> <input type="hidden" name="post_type[]" value="post" />February 24, 2017 at 1:59 pm #97275Anshuman SahuKeymasterYup this is an issue of now due to modification in search . Update releasing for this today . You would need to update wplms theme and also wplms one instructor theme .February 24, 2017 at 2:07 pm #97276Anshuman SahuKeymasterBut this issue appears only with child themes which are modifying header.php file . can you please share your site url and admin credentials in a private reply to check this at your end . PS : mark reply as private while sharing .February 24, 2017 at 3:46 pm #97332chinolzSpectatorAs i mentioned i managed to resolve the issue, My question is now how can i limit search results to the following? <input type="hidden" name="post_type[]" value="course" /> <input type="hidden" name="post_type[]" value="wpdmpro" /> <input type="hidden" name="post_type[]" value="post" /> where can i modify the search form?February 25, 2017 at 10:51 am #97460Anshuman SahuKeymasterHere is how you can do this : basically you need to remove the action for the search form and add it again to modify it . add_action('init','remove_search_modified_wplms'); function remove_search_modified_wplms(){ remove_action('wp_footer',array('WPLMS_Actions','search')); add_action('wp_footer','add_modified_search_wplms'); } function add_modified_search_wplms(){ //custom modified search form here ?> <div id="searchdiv"> <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> <input type="hidden" name="post_type[]" value="course" /> <input type="hidden" name="post_type[]" value="wpdmpro" /> <input type="hidden" name="post_type[]" value="post" /> <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" placeholder="<?php _e('Hit enter to search...','vibe'); ?>" /> <?php $course_search=vibe_get_option('course_search'); if(isset($course_search) && $course_search) echo '<input type="hidden" value="course" name="post_type" />'; ?> </form> <span></span> </div> <?php } Note that it is upto you how to handle this search on search.php or search-incourse.php file .
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- The topic ‘search not working after update to 2.6’ is closed to new replies.