keyword-search.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Template for displaying keyword search
  4. *
  5. * Override this template by copying it to yourtheme/simple_job_board/search/keyword-search.php
  6. *
  7. * @author PressTigers
  8. * @package Simple_Job_Board
  9. * @subpackage Simple_Job_Board/templates/search
  10. * @version 1.0.0
  11. * @since 2.2.3
  12. * @since 2.3.0 Added "sjb_keyword_search_template" filter.
  13. * @since 2.4.0 Revised whole HTML structure.
  14. */
  15. ob_start();
  16. if ( sjb_is_keyword_search() ) {
  17. $class = sjb_is_filter_dropdowns() ? 'col-md-12' : 'col-md-10';
  18. ?>
  19. <!-- Keywords Search-->
  20. <div class="sjb-search-keywords <?php echo $class; ?>">
  21. <div class="form-group">
  22. <?php
  23. $search_keyword = ( NULL != filter_input( INPUT_GET, 'search_keywords') ) ? filter_input( INPUT_GET, 'search_keywords' ) : '';
  24. // Append Query string With Page ID When Permalinks are not Set
  25. if (!get_option('permalink_structure') && !is_home() && !is_front_page()) {
  26. ?>
  27. <input type="hidden" value="<?php echo get_the_ID(); ?>" name="page_id" >
  28. <?php } ?>
  29. <label class="sr-only" for="keywords"><?php esc_html_e('Keywords', 'simple-job-board'); ?></label>
  30. <input type="text" class="form-control" value="<?php echo esc_attr( strip_tags( $search_keyword ) ); ?>" placeholder="<?php _e('Keywords', 'simple-job-board'); ?>" id="keywords" name="search_keywords">
  31. </div>
  32. </div>
  33. <?php
  34. }
  35. $html_keyword_search = ob_get_clean();
  36. /**
  37. * Modify the Keyword Search Template.
  38. *
  39. * @since 2.3.0
  40. *
  41. * @param html $html_keyword_search Keyword Search HTML.
  42. */
  43. echo apply_filters( 'sjb_keyword_search_template', $html_keyword_search );