| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * Displaying Search Results pages. |
|---|
| 4 | * @package Ultimate Ecommerce Shop |
|---|
| 5 | * @subpackage ultimate-ecommerce-shop |
|---|
| 6 | * @since 1.0 |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | get_header(); ?> |
|---|
| 10 | |
|---|
| 11 | <?php /** post section **/ ?> |
|---|
| 12 | |
|---|
| 13 | <div class="container"> |
|---|
| 14 | <main id="main" role="main" class="content-with-sidebar"> |
|---|
| 15 | <?php |
|---|
| 16 | $ultimate_ecommerce_shop_layout = get_theme_mod( 'ultimate_ecommerce_shop_theme_options','Right Sidebar'); |
|---|
| 17 | if($ultimate_ecommerce_shop_layout == 'One Column'){?> |
|---|
| 18 | <div id="firstbox" > |
|---|
| 19 | <?php if ( have_posts() ) : ?> |
|---|
| 20 | <h1 class="search-title"><?php /* translators: %s: search term */ printf(esc_html('Search Results for: %s','ultimate-ecommerce-shop'), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1> |
|---|
| 21 | <?php else : ?> |
|---|
| 22 | <h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'ultimate-ecommerce-shop' ); ?></h1> |
|---|
| 23 | <?php endif; ?> |
|---|
| 24 | <?php if ( have_posts() ) : |
|---|
| 25 | /* Start the Loop */ |
|---|
| 26 | while ( have_posts() ) : the_post(); |
|---|
| 27 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 28 | endwhile; |
|---|
| 29 | else : ?> |
|---|
| 30 | <p class="sorry-text"><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'ultimate-ecommerce-shop' ); ?></p> |
|---|
| 31 | <?php |
|---|
| 32 | get_search_form(); |
|---|
| 33 | endif; |
|---|
| 34 | ?> |
|---|
| 35 | <div class="navigation"> |
|---|
| 36 | <?php |
|---|
| 37 | // Previous/next page navigation. |
|---|
| 38 | the_posts_pagination( array( |
|---|
| 39 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 40 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 41 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 42 | )); |
|---|
| 43 | ?> |
|---|
| 44 | </div> |
|---|
| 45 | </div> |
|---|
| 46 | <div class="clearfix"></div> |
|---|
| 47 | <?php }else if($ultimate_ecommerce_shop_layout == 'Three Columns'){?> |
|---|
| 48 | <div class="row"> |
|---|
| 49 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 50 | <div id="firstbox" class="col-lg-6 col-md-6"> |
|---|
| 51 | <?php if ( have_posts() ) : ?> |
|---|
| 52 | <h1> class="search-title"><?php /* translators: %s: search term */ printf(esc_html('Search Results for: %s','ultimate-ecommerce-shop'), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1> |
|---|
| 53 | <?php else : ?> |
|---|
| 54 | <h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'ultimate-ecommerce-shop' ); ?></h1> |
|---|
| 55 | <?php endif; ?> |
|---|
| 56 | <?php if ( have_posts() ) : |
|---|
| 57 | /* Start the Loop */ |
|---|
| 58 | while ( have_posts() ) : the_post(); |
|---|
| 59 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 60 | endwhile; |
|---|
| 61 | else : ?> |
|---|
| 62 | <p class="sorry-text"><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'ultimate-ecommerce-shop' ); ?></p> |
|---|
| 63 | <?php |
|---|
| 64 | get_search_form(); |
|---|
| 65 | endif; |
|---|
| 66 | ?> |
|---|
| 67 | <div class="navigation"> |
|---|
| 68 | <?php |
|---|
| 69 | // Previous/next page navigation. |
|---|
| 70 | the_posts_pagination( array( |
|---|
| 71 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 72 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 73 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 74 | ) ); |
|---|
| 75 | ?> |
|---|
| 76 | </div> |
|---|
| 77 | </div> |
|---|
| 78 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 79 | </div> |
|---|
| 80 | <?php }else if($ultimate_ecommerce_shop_layout == 'Four Columns'){?> |
|---|
| 81 | <div class="row"> |
|---|
| 82 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 83 | <div id="firstbox" class="col-lg-3 col-md-3"> |
|---|
| 84 | <?php if ( have_posts() ) : ?> |
|---|
| 85 | <h1 class="search-title"><?php /* translators: %s: search term */ printf(esc_html('Search Results for: %s','ultimate-ecommerce-shop'), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1> |
|---|
| 86 | <h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'ultimate-ecommerce-shop' ); ?></h1> |
|---|
| 87 | <?php endif; ?> |
|---|
| 88 | <?php if ( have_posts() ) : |
|---|
| 89 | /* Start the Loop */ |
|---|
| 90 | while ( have_posts() ) : the_post(); |
|---|
| 91 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 92 | endwhile; |
|---|
| 93 | else : ?> |
|---|
| 94 | <p class="sorry-text"><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'ultimate-ecommerce-shop' ); ?></p> |
|---|
| 95 | <?php |
|---|
| 96 | get_search_form(); |
|---|
| 97 | endif; |
|---|
| 98 | ?> |
|---|
| 99 | <div class="navigation"> |
|---|
| 100 | <?php |
|---|
| 101 | // Previous/next page navigation. |
|---|
| 102 | the_posts_pagination( array( |
|---|
| 103 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 104 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 105 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 106 | ) ); |
|---|
| 107 | ?> |
|---|
| 108 | </div> |
|---|
| 109 | </div> |
|---|
| 110 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 111 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-3'); ?></div> |
|---|
| 112 | </div> |
|---|
| 113 | <?php }else if($ultimate_ecommerce_shop_layout == 'Right Sidebar'){?> |
|---|
| 114 | <div class="row"> |
|---|
| 115 | <div id="firstbox" class="col-lg-8 col-md-8"> |
|---|
| 116 | <?php if ( have_posts() ) : ?> |
|---|
| 117 | <h1 class="search-title"><?php /* translators: %s: search term */ printf(esc_html('Search Results for: %s','ultimate-ecommerce-shop'), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1> |
|---|
| 118 | <?php else : ?> |
|---|
| 119 | <h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'ultimate-ecommerce-shop' ); ?></h1> |
|---|
| 120 | <?php endif; ?> |
|---|
| 121 | <?php if ( have_posts() ) : |
|---|
| 122 | /* Start the Loop */ |
|---|
| 123 | while ( have_posts() ) : the_post(); |
|---|
| 124 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 125 | endwhile; |
|---|
| 126 | else : ?> |
|---|
| 127 | <p class="sorry-text"><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'ultimate-ecommerce-shop' ); ?></p> |
|---|
| 128 | <?php |
|---|
| 129 | get_search_form(); |
|---|
| 130 | endif; |
|---|
| 131 | ?> |
|---|
| 132 | <div class="navigation"> |
|---|
| 133 | <?php |
|---|
| 134 | // Previous/next page navigation. |
|---|
| 135 | the_posts_pagination( array( |
|---|
| 136 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 137 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 138 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 139 | )); |
|---|
| 140 | ?> |
|---|
| 141 | </div> |
|---|
| 142 | </div> |
|---|
| 143 | <div class="col-lg-4 col-md-4"><?php get_sidebar(); ?></div> |
|---|
| 144 | </div> |
|---|
| 145 | <?php }else if($ultimate_ecommerce_shop_layout == 'Left Sidebar'){?> |
|---|
| 146 | <div class="row"> |
|---|
| 147 | <div class="col-lg-4 col-md-4"><?php get_sidebar(); ?></div> |
|---|
| 148 | <div id="firstbox" class="col-lg-8 col-md-8"> |
|---|
| 149 | <?php if ( have_posts() ) : ?> |
|---|
| 150 | <h1 class="search-title"><?php /* translators: %s: search term */ printf(esc_html('Search Results for: %s','ultimate-ecommerce-shop'), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1> |
|---|
| 151 | <?php else : ?> |
|---|
| 152 | <h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'ultimate-ecommerce-shop' ); ?></h1> |
|---|
| 153 | <?php endif; ?> |
|---|
| 154 | <?php if ( have_posts() ) : |
|---|
| 155 | /* Start the Loop */ |
|---|
| 156 | while ( have_posts() ) : the_post(); |
|---|
| 157 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 158 | endwhile; |
|---|
| 159 | else : ?> |
|---|
| 160 | <p class="sorry-text"><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'ultimate-ecommerce-shop' ); ?></p> |
|---|
| 161 | <?php |
|---|
| 162 | get_search_form(); |
|---|
| 163 | endif; |
|---|
| 164 | ?> |
|---|
| 165 | <div class="navigation"> |
|---|
| 166 | <?php |
|---|
| 167 | // Previous/next page navigation. |
|---|
| 168 | the_posts_pagination( array( |
|---|
| 169 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 170 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 171 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 172 | ) ); |
|---|
| 173 | ?> |
|---|
| 174 | </div> |
|---|
| 175 | </div> |
|---|
| 176 | </div> |
|---|
| 177 | <?php }else if($ultimate_ecommerce_shop_layout == 'Grid Layout'){?> |
|---|
| 178 | <div id="firstbox"> |
|---|
| 179 | <?php if ( have_posts() ) : ?> |
|---|
| 180 | <h1 class="search-title"><?php /* translators: %s: search term */ printf(esc_html('Search Results for: %s','ultimate-ecommerce-shop'), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1> |
|---|
| 181 | <?php else : ?> |
|---|
| 182 | <h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'ultimate-ecommerce-shop' ); ?></h1> |
|---|
| 183 | <?php endif; ?> |
|---|
| 184 | <div class="row"> |
|---|
| 185 | <?php if ( have_posts() ) : |
|---|
| 186 | /* Start the Loop */ |
|---|
| 187 | while ( have_posts() ) : the_post(); |
|---|
| 188 | get_template_part( 'template-parts/post/grid-layout' ); |
|---|
| 189 | endwhile; |
|---|
| 190 | else : ?> |
|---|
| 191 | <p class="sorry-text"><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'ultimate-ecommerce-shop' ); ?></p> |
|---|
| 192 | <?php |
|---|
| 193 | get_search_form(); |
|---|
| 194 | endif; |
|---|
| 195 | ?> |
|---|
| 196 | </div> |
|---|
| 197 | <div class="navigation"> |
|---|
| 198 | <?php |
|---|
| 199 | // Previous/next page navigation. |
|---|
| 200 | the_posts_pagination( array( |
|---|
| 201 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 202 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 203 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 204 | )); |
|---|
| 205 | ?> |
|---|
| 206 | </div> |
|---|
| 207 | </div> |
|---|
| 208 | <?php }else {?> |
|---|
| 209 | <div class="row"> |
|---|
| 210 | <div id="firstbox" class="col-lg-8 col-md-8"> |
|---|
| 211 | <?php if ( have_posts() ) : ?> |
|---|
| 212 | <h1 class="search-title"><?php /* translators: %s: search term */ printf(esc_html('Search Results for: %s','ultimate-ecommerce-shop'), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1> |
|---|
| 213 | <?php else : ?> |
|---|
| 214 | <h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'ultimate-ecommerce-shop' ); ?></h1> |
|---|
| 215 | <?php endif; ?> |
|---|
| 216 | <?php if ( have_posts() ) : |
|---|
| 217 | /* Start the Loop */ |
|---|
| 218 | while ( have_posts() ) : the_post(); |
|---|
| 219 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 220 | endwhile; |
|---|
| 221 | else : ?> |
|---|
| 222 | <p class="sorry-text"><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'ultimate-ecommerce-shop' ); ?></p> |
|---|
| 223 | <?php |
|---|
| 224 | get_search_form(); |
|---|
| 225 | endif; |
|---|
| 226 | ?> |
|---|
| 227 | <div class="navigation"> |
|---|
| 228 | <?php |
|---|
| 229 | // Previous/next page navigation. |
|---|
| 230 | the_posts_pagination( array( |
|---|
| 231 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 232 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 233 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 234 | )); |
|---|
| 235 | ?> |
|---|
| 236 | </div> |
|---|
| 237 | </div> |
|---|
| 238 | <div class="col-lg-4 col-md-4"><?php get_sidebar(); ?></div> |
|---|
| 239 | </div> |
|---|
| 240 | <?php } ?> |
|---|
| 241 | </main> |
|---|
| 242 | </div> |
|---|
| 243 | |
|---|
| 244 | <?php get_footer(); ?> |
|---|