| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * Displaying home page. |
|---|
| 4 | * |
|---|
| 5 | * This template display post by default. |
|---|
| 6 | * @package Ultimate Ecommerce Shop |
|---|
| 7 | */ |
|---|
| 8 | get_header(); ?> |
|---|
| 9 | |
|---|
| 10 | <?php do_action( 'ultimate_ecommerce_shop_index_header' ); ?> |
|---|
| 11 | |
|---|
| 12 | <?php /** post section **/ ?> |
|---|
| 13 | |
|---|
| 14 | <div class="container"> |
|---|
| 15 | <main id="main" role="main" class="content-with-sidebar py-3"> |
|---|
| 16 | <?php |
|---|
| 17 | $ultimate_ecommerce_shop_layout = get_theme_mod( 'ultimate_ecommerce_shop_theme_options','Right Sidebar'); |
|---|
| 18 | if($ultimate_ecommerce_shop_layout == 'One Column'){?> |
|---|
| 19 | <div id="firstbox"> |
|---|
| 20 | <?php if ( have_posts() ) : |
|---|
| 21 | /* Start the Loop */ |
|---|
| 22 | while ( have_posts() ) : the_post(); |
|---|
| 23 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 24 | endwhile; |
|---|
| 25 | else : |
|---|
| 26 | get_template_part( 'no-results' ); |
|---|
| 27 | endif; |
|---|
| 28 | ?> |
|---|
| 29 | <div class="navigation"> |
|---|
| 30 | <?php |
|---|
| 31 | // Previous/next page navigation. |
|---|
| 32 | the_posts_pagination( array( |
|---|
| 33 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 34 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 35 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 36 | ) ); |
|---|
| 37 | ?> |
|---|
| 38 | <div class="clearfix"></div> |
|---|
| 39 | </div> |
|---|
| 40 | </div> |
|---|
| 41 | <div class="clearfix"></div> |
|---|
| 42 | <?php }else if($ultimate_ecommerce_shop_layout == 'Three Columns'){?> |
|---|
| 43 | <div class="row"> |
|---|
| 44 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 45 | <div id="firstbox" class="col-lg-6 col-md-6"> |
|---|
| 46 | <?php if ( have_posts() ) : |
|---|
| 47 | /* Start the Loop */ |
|---|
| 48 | while ( have_posts() ) : the_post(); |
|---|
| 49 | get_template_part( 'template-parts/post/content', get_post_format() ); |
|---|
| 50 | endwhile; |
|---|
| 51 | else : |
|---|
| 52 | get_template_part( 'no-results' ); |
|---|
| 53 | endif; |
|---|
| 54 | ?> |
|---|
| 55 | <div class="navigation"> |
|---|
| 56 | <?php |
|---|
| 57 | // Previous/next page navigation. |
|---|
| 58 | the_posts_pagination( array( |
|---|
| 59 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 60 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 61 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 62 | ) ); |
|---|
| 63 | ?> |
|---|
| 64 | <div class="clearfix"></div> |
|---|
| 65 | </div> |
|---|
| 66 | </div> |
|---|
| 67 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 68 | </div> |
|---|
| 69 | <?php }else if($ultimate_ecommerce_shop_layout == 'Four Columns'){?> |
|---|
| 70 | <div class="row"> |
|---|
| 71 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 72 | <div id="firstbox" class="col-lg-3 col-md-3"> |
|---|
| 73 | <?php if ( have_posts() ) : |
|---|
| 74 | /* Start the Loop */ |
|---|
| 75 | while ( have_posts() ) : the_post(); |
|---|
| 76 | get_template_part( 'template-parts/post/content',get_post_format() ); |
|---|
| 77 | endwhile; |
|---|
| 78 | else : |
|---|
| 79 | get_template_part( 'no-results' ); |
|---|
| 80 | endif; |
|---|
| 81 | ?> |
|---|
| 82 | <div class="navigation"> |
|---|
| 83 | <?php |
|---|
| 84 | // Previous/next page navigation. |
|---|
| 85 | the_posts_pagination( array( |
|---|
| 86 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 87 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 88 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 89 | ) ); |
|---|
| 90 | ?> |
|---|
| 91 | <div class="clearfix"></div> |
|---|
| 92 | </div> |
|---|
| 93 | </div> |
|---|
| 94 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-2'); ?></div> |
|---|
| 95 | <div id="sidebar" class="col-lg-3 col-md-3"><?php dynamic_sidebar('sidebar-3'); ?></div> |
|---|
| 96 | </div> |
|---|
| 97 | <?php }else if($ultimate_ecommerce_shop_layout == 'Right Sidebar'){?> |
|---|
| 98 | <div class="row"> |
|---|
| 99 | <div id="firstbox" class="col-lg-8 col-md-8"> |
|---|
| 100 | <?php if ( have_posts() ) : |
|---|
| 101 | /* Start the Loop */ |
|---|
| 102 | while ( have_posts() ) : the_post(); |
|---|
| 103 | get_template_part( 'template-parts/post/content',get_post_format() ); |
|---|
| 104 | endwhile; |
|---|
| 105 | else : |
|---|
| 106 | get_template_part( 'no-results' ); |
|---|
| 107 | endif; |
|---|
| 108 | ?> |
|---|
| 109 | <div class="navigation"> |
|---|
| 110 | <?php |
|---|
| 111 | // Previous/next page navigation. |
|---|
| 112 | the_posts_pagination( array( |
|---|
| 113 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 114 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 115 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 116 | ) ); |
|---|
| 117 | ?> |
|---|
| 118 | <div class="clearfix"></div> |
|---|
| 119 | </div> |
|---|
| 120 | </div> |
|---|
| 121 | <div class="col-lg-4 col-md-4"><?php get_sidebar(); ?></div> |
|---|
| 122 | </div> |
|---|
| 123 | <?php }else if($ultimate_ecommerce_shop_layout == 'Left Sidebar'){?> |
|---|
| 124 | <div class="row"> |
|---|
| 125 | <div class="col-lg-4 col-md-4"><?php get_sidebar(); ?></div> |
|---|
| 126 | <div id="firstbox" class="col-lg-8 col-md-8"> |
|---|
| 127 | <?php if ( have_posts() ) : |
|---|
| 128 | /* Start the Loop */ |
|---|
| 129 | while ( have_posts() ) : the_post(); |
|---|
| 130 | get_template_part( 'template-parts/post/content',get_post_format() ); |
|---|
| 131 | endwhile; |
|---|
| 132 | else : |
|---|
| 133 | get_template_part( 'no-results' ); |
|---|
| 134 | endif; |
|---|
| 135 | ?> |
|---|
| 136 | <div class="navigation"> |
|---|
| 137 | <?php |
|---|
| 138 | // Previous/next page navigation. |
|---|
| 139 | the_posts_pagination( array( |
|---|
| 140 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 141 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 142 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 143 | ) ); |
|---|
| 144 | ?> |
|---|
| 145 | <div class="clearfix"></div> |
|---|
| 146 | </div> |
|---|
| 147 | </div> |
|---|
| 148 | </div> |
|---|
| 149 | <?php }else if($ultimate_ecommerce_shop_layout == 'Grid Layout'){?> |
|---|
| 150 | <div id="firstbox" > |
|---|
| 151 | <div class="row"> |
|---|
| 152 | <?php if ( have_posts() ) : |
|---|
| 153 | /* Start the Loop */ |
|---|
| 154 | while ( have_posts() ) : the_post(); |
|---|
| 155 | get_template_part( 'template-parts/post/grid-layout' ); |
|---|
| 156 | endwhile; |
|---|
| 157 | else : |
|---|
| 158 | get_template_part( 'no-results' ); |
|---|
| 159 | endif; |
|---|
| 160 | ?> |
|---|
| 161 | </div> |
|---|
| 162 | <div class="navigation"> |
|---|
| 163 | <?php |
|---|
| 164 | // Previous/next page navigation. |
|---|
| 165 | the_posts_pagination( array( |
|---|
| 166 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 167 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 168 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 169 | ) ); |
|---|
| 170 | ?> |
|---|
| 171 | <div class="clearfix"></div> |
|---|
| 172 | </div> |
|---|
| 173 | </div> |
|---|
| 174 | <?php }else {?> |
|---|
| 175 | <div class="row"> |
|---|
| 176 | <div id="firstbox" class="col-lg-8 col-md-8"> |
|---|
| 177 | <?php if ( have_posts() ) : |
|---|
| 178 | /* Start the Loop */ |
|---|
| 179 | while ( have_posts() ) : the_post(); |
|---|
| 180 | get_template_part( 'template-parts/post/content',get_post_format() ); |
|---|
| 181 | endwhile; |
|---|
| 182 | else : |
|---|
| 183 | get_template_part( 'no-results' ); |
|---|
| 184 | endif; |
|---|
| 185 | ?> |
|---|
| 186 | <div class="navigation"> |
|---|
| 187 | <?php |
|---|
| 188 | // Previous/next page navigation. |
|---|
| 189 | the_posts_pagination( array( |
|---|
| 190 | 'prev_text' => __( 'Previous page', 'ultimate-ecommerce-shop' ), |
|---|
| 191 | 'next_text' => __( 'Next page', 'ultimate-ecommerce-shop' ), |
|---|
| 192 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'ultimate-ecommerce-shop' ) . ' </span>', |
|---|
| 193 | ) ); |
|---|
| 194 | ?> |
|---|
| 195 | <div class="clearfix"></div> |
|---|
| 196 | </div> |
|---|
| 197 | </div> |
|---|
| 198 | <div class="col-lg-4 col-md-4"><?php get_sidebar(); ?></div> |
|---|
| 199 | </div> |
|---|
| 200 | <?php } ?> |
|---|
| 201 | </main> |
|---|
| 202 | </div> |
|---|
| 203 | |
|---|
| 204 | <?php do_action( 'ultimate_ecommerce_shop_index_footer' ); ?> |
|---|
| 205 | |
|---|
| 206 | <?php get_footer(); ?> |
|---|