search
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
12 changed files
with
267 additions
and
1 deletions
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
wp-content/themes/msf-child/search.php
0 → 100644
| 1 | <?php | ||
| 2 | /** | ||
| 3 | * The template for displaying search results pages | ||
| 4 | * | ||
| 5 | * @package Understrap | ||
| 6 | */ | ||
| 7 | |||
| 8 | // Exit if accessed directly. | ||
| 9 | defined( 'ABSPATH' ) || exit; | ||
| 10 | |||
| 11 | get_header(); | ||
| 12 | |||
| 13 | $container = get_theme_mod( 'understrap_container_type' ); | ||
| 14 | |||
| 15 | ?> | ||
| 16 | |||
| 17 | <div class="wrapper" id="search-wrapper"> | ||
| 18 | |||
| 19 | <div class="<?php echo esc_attr( $container ); ?> container" id="content" tabindex="-1"> | ||
| 20 | <h1 class="sh1"><?php _e("Search results for:", 'msf'); ?></h1> | ||
| 21 | <?php //get_search_form() ?> | ||
| 22 | <?php echo do_shortcode('[searchandfilter slug="what-are-you-looking-for-today"]'); ?> | ||
| 23 | <?php //echo do_shortcode('[searchandfilter id="21964"]'); ?> | ||
| 24 | <button class="btn btn-primary filter" data-bs-toggle="collapse" data-bs-target="#search-sidebar" role="button" aria-expanded="false" aria-controls="search-sidebar" > | ||
| 25 | <?php _e("SORT AND FILTER", 'msf'); ?> | ||
| 26 | </button> | ||
| 27 | <div class="search-wrapper row"> | ||
| 28 | |||
| 29 | <div class="col-sm-12 col-md-3 widget-area collapse" id="search-sidebar"> | ||
| 30 | <?php echo do_shortcode('[searchandfilter slug="search"]'); ?> | ||
| 31 | <button class="btn btn-primary filter apply-filters" data-bs-toggle="collapse" data-bs-target="#search-sidebar" role="button" aria-expanded="false" aria-controls="search-sidebar" > | ||
| 32 | <?php _e("APPLY FILTERS", 'msf'); ?> | ||
| 33 | </button> | ||
| 34 | </div> | ||
| 35 | <main class="col-sm-12 col-md-9 content-area site-main search-result" id="main"> | ||
| 36 | |||
| 37 | |||
| 38 | <?php if ( have_posts() ) : | ||
| 39 | global $wp_query; | ||
| 40 | |||
| 41 | |||
| 42 | ?> | ||
| 43 | |||
| 44 | <header class="page-header"> | ||
| 45 | |||
| 46 | <h3 class="page-title"> | ||
| 47 | <?php | ||
| 48 | printf( | ||
| 49 | /* translators: %s: query term */ | ||
| 50 | esc_html__( 'SHOWING: %s', 'understrap' ), | ||
| 51 | '<span>' .$wp_query->found_posts. '</span>' | ||
| 52 | ); | ||
| 53 | ?> | ||
| 54 | </h3> | ||
| 55 | |||
| 56 | </header><!-- .page-header --> | ||
| 57 | |||
| 58 | <?php /* Start the Loop */ ?> | ||
| 59 | <?php | ||
| 60 | while ( have_posts() ) : | ||
| 61 | the_post(); | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Run the loop for the search to output the results. | ||
| 65 | * If you want to overload this in a child theme then include a file | ||
| 66 | * called content-search.php and that will be used instead. | ||
| 67 | */ | ||
| 68 | get_template_part( 'loop-templates/content', 'search' ); | ||
| 69 | endwhile; | ||
| 70 | ?> | ||
| 71 | |||
| 72 | <?php else : ?> | ||
| 73 | |||
| 74 | <?php get_template_part( 'loop-templates/content', 'none' ); ?> | ||
| 75 | |||
| 76 | <?php endif; ?> | ||
| 77 | |||
| 78 | </main><!-- #main --> | ||
| 79 | |||
| 80 | <!-- The pagination component --> | ||
| 81 | |||
| 82 | </div> | ||
| 83 | |||
| 84 | <!-- The pagination component --> | ||
| 85 | <?php understrap_pagination(); ?> | ||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | </div><!-- #content --> | ||
| 90 | |||
| 91 | </div><!-- #search-wrapper --> | ||
| 92 | |||
| 93 | <?php | ||
| 94 | get_footer(); |
wp-content/themes/msf-child/searchform.php
0 → 100644
| 1 | <?php | ||
| 2 | /** | ||
| 3 | * The template for displaying search forms | ||
| 4 | * | ||
| 5 | * @package Understrap | ||
| 6 | */ | ||
| 7 | |||
| 8 | // Exit if accessed directly. | ||
| 9 | defined( 'ABSPATH' ) || exit; | ||
| 10 | |||
| 11 | $bootstrap_version = get_theme_mod( 'understrap_bootstrap_version', 'bootstrap4' ); | ||
| 12 | $uid = wp_unique_id( 's-' ); // The search form specific unique ID for the input. | ||
| 13 | |||
| 14 | $aria_label = ''; | ||
| 15 | if ( isset( $args['aria_label'] ) && ! empty( $args['aria_label'] ) ) { | ||
| 16 | $aria_label = 'aria-label="' . esc_attr( $args['aria_label'] ) . '"'; | ||
| 17 | } | ||
| 18 | ?> | ||
| 19 | <div class="side-menu input-group"> | ||
| 20 | <?php echo do_shortcode('[searchandfilter slug="what-are-you-looking-for-today"]'); ?> | ||
| 21 | </div> | ||
| 22 | <!-- <form role="search" class="search-form" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" <?php echo $aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?>> | ||
| 23 | <label class="screen-reader-text" for="<?php echo $uid; ?>"><?php echo esc_html_x( 'Search for:', 'label', 'understrap' ); ?></label> | ||
| 24 | <div class="input-group"> | ||
| 25 | <input type="hidden" class="field search-field form-control" id="<?php echo $uid; ?>" name="s" value="<?php the_search_query(); ?>" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'understrap' ); ?>"> | ||
| 26 | <input type="search" class="field search-field form-control" name="_sf_s" value="<?php echo $_GET['_sf_s']; ?>" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'understrap' ); ?>"> | ||
| 27 | <?php if ( 'bootstrap5' === $bootstrap_version ) : ?> | ||
| 28 | <input type="submit" class="submit search-submit btn btn-primary" name="submit" value="<?php echo esc_attr_x( 'OK', 'submit button', 'understrap' ); ?>"> | ||
| 29 | <?php else : ?> | ||
| 30 | <span class="input-group-append"> | ||
| 31 | <input type="submit" class="submit search-submit btn btn-primary" name="submit" value="<?php echo esc_attr_x( 'OK', 'submit button', 'understrap' ); ?>"> | ||
| 32 | </span> | ||
| 33 | <?php endif; ?> | ||
| 34 | </div> | ||
| 35 | </form> --> | ||
| 36 | |||
| 37 | <?php |
| 1 | |||
| 2 | .select { | ||
| 3 | &:after { | ||
| 4 | content:''; | ||
| 5 | display: block; | ||
| 6 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16.175' height='9.808' viewBox='0 0 16.175 9.808'%3E%3Cpath id='Path_1396' data-name='Path 1396' d='M19.409 190.005c.561-.568 1.11-1.13 1.667-1.686q2-2 4.01-4a.9.9 0 0 1 1.329 0c.254.261.515.516.772.774a.881.881 0 0 1-.005 1.318q-1.8 1.8-3.605 3.606-1.748 1.75-3.495 3.5a.975.975 0 0 1-.654.312.931.931 0 0 1-.719-.31q-1.349-1.354-2.7-2.706-1.836-1.838-3.674-3.675c-.25-.25-.5-.5-.75-.75A.876.876 0 0 1 11.6 185.1l.766-.766a.9.9 0 0 1 1.348 0l3.252 3.24 2.355 2.345C19.339 189.941 19.363 189.962 19.409 190.005Z' transform='translate(-11.305 -184.028)'/%3E%3C/svg%3E"); | ||
| 7 | background-size: contain; | ||
| 8 | background-repeat: no-repeat; | ||
| 9 | width: 1rem; | ||
| 10 | height: 0.5rem; | ||
| 11 | position: absolute; | ||
| 12 | right: 0; | ||
| 13 | } | ||
| 14 | &:hover { | ||
| 15 | &:after { | ||
| 16 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16.175' height='9.808' viewBox='0 0 16.175 9.808'%3E%3Cpath id='Path_1396' data-name='Path 1396' d='M19.409 190.005c.561-.568 1.11-1.13 1.667-1.686q2-2 4.01-4a.9.9 0 0 1 1.329 0c.254.261.515.516.772.774a.881.881 0 0 1-.005 1.318q-1.8 1.8-3.605 3.606-1.748 1.75-3.495 3.5a.975.975 0 0 1-.654.312.931.931 0 0 1-.719-.31q-1.349-1.354-2.7-2.706-1.836-1.838-3.674-3.675c-.25-.25-.5-.5-.75-.75A.876.876 0 0 1 11.6 185.1l.766-.766a.9.9 0 0 1 1.348 0l3.252 3.24 2.355 2.345C19.339 189.941 19.363 189.962 19.409 190.005Z' transform='translate(-11.305 -184.028)' fill='%23699'/%3E%3C/svg%3E"); | ||
| 17 | background-size: contain; | ||
| 18 | background-repeat: no-repeat; | ||
| 19 | } | ||
| 20 | } | ||
| 21 | } | ||
| 22 | |||
| 23 | // Learn about this solution to creating custom select styles: | ||
| 24 | // @link https://moderncss.dev/custom-select-styles-with-pure-css/ | ||
| 25 | |||
| 26 | select { | ||
| 27 | // A reset of styles, including removing the default dropdown arrow | ||
| 28 | appearance: none; | ||
| 29 | background-color: transparent; | ||
| 30 | border: none; | ||
| 31 | margin: 0; | ||
| 32 | width: 100%; | ||
| 33 | font-family: inherit; | ||
| 34 | font-size: inherit; | ||
| 35 | cursor: inherit; | ||
| 36 | line-height: inherit; | ||
| 37 | color:#4D4D4D; | ||
| 38 | font-family: "PT Sans",sans-serif; | ||
| 39 | font-size: 1rem; | ||
| 40 | |||
| 41 | // Stack above custom arrow | ||
| 42 | z-index: 1; | ||
| 43 | |||
| 44 | // Remove dropdown arrow in IE10 & IE11 | ||
| 45 | // @link https://www.filamentgroup.com/lab/select-css.html | ||
| 46 | &::-ms-expand { | ||
| 47 | display: none; | ||
| 48 | } | ||
| 49 | |||
| 50 | // Remove focus outline, will add on alternate element | ||
| 51 | outline: none; | ||
| 52 | } | ||
| 53 | |||
| 54 | .select { | ||
| 55 | display: grid; | ||
| 56 | grid-template-areas: "select"; | ||
| 57 | align-items: center; | ||
| 58 | position: relative; | ||
| 59 | |||
| 60 | select, | ||
| 61 | &::after { | ||
| 62 | grid-area: select; | ||
| 63 | } | ||
| 64 | |||
| 65 | select { | ||
| 66 | border: 0 !important; | ||
| 67 | } | ||
| 68 | |||
| 69 | min-width: 15ch; | ||
| 70 | max-width: 30ch; | ||
| 71 | |||
| 72 | padding: 0.506rem; | ||
| 73 | |||
| 74 | font-size: 1rem; | ||
| 75 | cursor: pointer; | ||
| 76 | line-height: 1.1; | ||
| 77 | |||
| 78 | // Optional styles | ||
| 79 | // remove for transparency | ||
| 80 | background-color: #fff; | ||
| 81 | border:1px solid #BEBEBE; | ||
| 82 | |||
| 83 | } | ||
| 84 | |||
| 85 | // Interim solution until :focus-within has better support | ||
| 86 | select:focus + .focus { | ||
| 87 | position: absolute; | ||
| 88 | top: -1px; | ||
| 89 | left: -1px; | ||
| 90 | right: -1px; | ||
| 91 | bottom: -1px; | ||
| 92 | border: 2px solid var(--select-focus); | ||
| 93 | border-radius: inherit; | ||
| 94 | } | ||
| 95 | |||
| 96 | select[multiple] { | ||
| 97 | padding-right: 0; | ||
| 98 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | |||
| 2 | body { | ||
| 3 | |||
| 4 | font-family: "PT Sans",sans-serif; | ||
| 5 | } | ||
| 6 | |||
| 7 | * { | ||
| 8 | font-family: "PT Sans",sans-serif; | ||
| 9 | -webkit-font-smoothing: antialiased; | ||
| 10 | } | ||
| 11 | |||
| 12 | a.skip-link { | ||
| 13 | display: none; | ||
| 14 | left:0; | ||
| 15 | opacity: 0; | ||
| 16 | &:focus { | ||
| 17 | opacity: 1; | ||
| 18 | } | ||
| 19 | } | ||
| 20 | |||
| 21 | .fr-only { | ||
| 22 | display: none !important; | ||
| 23 | } | ||
| 24 | |||
| 25 | html:lang(fr-FR) { | ||
| 26 | .en-only { | ||
| 27 | display: none !important; | ||
| 28 | } | ||
| 29 | .fr-only { | ||
| 30 | display: inline-block !important; | ||
| 31 | } | ||
| 32 | } |
This diff is collapsed.
Click to expand it.
| ... | @@ -45,7 +45,7 @@ | ... | @@ -45,7 +45,7 @@ |
| 45 | padding-left: 0px; | 45 | padding-left: 0px; |
| 46 | } | 46 | } |
| 47 | .searchandfilter h4{ | 47 | .searchandfilter h4{ |
| 48 | font-size: 45px; | 48 | font-size: 45px !important; |
| 49 | line-height: 53px; | 49 | line-height: 53px; |
| 50 | text-align: center; | 50 | text-align: center; |
| 51 | font-weight: lighter; | 51 | font-weight: lighter; | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment