Advertisement
nuxrif

product

Jul 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.37 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Products 6-1 with categories block
  4.  *
  5.  * @package Electro/Templates
  6.  */
  7.  
  8. if ( ! defined( 'ABSPATH' ) ) {
  9.     exit;
  10. }
  11.  
  12. $section_class = empty( $section_class ) ? 'products-6-1-with-categories' : 'products-6-1-with-categories ' . $section_class;
  13.  
  14. if ( ! empty( $animation ) ) {
  15.     $section_class .= ' animate-in-view';
  16. }
  17.  
  18. $show_nav = ! empty( $categories ) && ! is_wp_error( $categories );
  19. ?>
  20. <section class="<?php echo esc_attr( $section_class ); ?>" <?php if ( !empty( $animation ) ) : ?>data-animation="<?php echo esc_attr( $animation );?>"<?php endif; ?>>
  21.     <header <?php if( $show_nav ): ?>class="show-nav"<?php endif; ?>>
  22.         <h2 class="h1"><?php echo esc_html( $section_title ); ?></h2>
  23.         <?php if ( true === $show_nav ) : ?>
  24.             <ul class="nav nav-inline">
  25.                 <?php if ( ! empty( $categories_title ) ) : ?>
  26.                     <li class="nav-item active">
  27.                         <span class="nav-link"><?php echo esc_html( $categories_title ); ?></span>
  28.                     </li>
  29.                 <?php endif; ?>
  30.                 <?php foreach( $categories as $category ) : ?>
  31.                     <li class="nav-item">
  32.                         <a class="nav-link" href="<?php echo esc_url( get_term_link( $category ) ); ?>"><?php echo esc_html( $category->name ); ?></a>
  33.                     </li>
  34.                 <?php endforeach; ?>
  35.             </ul>
  36.         <?php endif; ?>
  37.     </header>
  38.     <div class="products-6-1-with-categories-inner">
  39.         <?php if ( ! empty( $vcategories ) && ! is_wp_error( $vcategories ) ) : ?>
  40.         <div class="categories-menu-list">
  41.             <ul class="nav">
  42.                 <?php foreach( $vcategories as $vcategory ) : ?>
  43.                 <li class="nav-item">
  44.                     <a class="nav-link" href="<?php echo esc_url( get_term_link( $vcategory ) ); ?>"><?php echo esc_html( $vcategory->name ); ?></a>
  45.                 </li>
  46.                 <?php endforeach; ?>
  47.             </ul>
  48.         </div>
  49.         <?php endif; ?>
  50.  
  51.         <div class="products-block">
  52.             <div class="columns-6">
  53.  
  54.                 <div class="products-6">
  55.                     <?php echo electro_do_shortcode( $shortcode_tag,  wp_parse_args( array( 'columns' => 6, 'per_page' => 12 ), $shortcode_atts ) ); ?>
  56.                 </div>
  57.             </div>
  58.         </div>
  59.     </div>
  60. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement