Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.06 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The secton Masthead
  4.  */
  5. ?>
  6.  
  7. <!-- Masthead -->
  8. <section id="masthead" class="masthead">
  9.     <div class="section-home-cats">
  10.         <div class="container">
  11.             <div class="row">
  12.                 <div class="col-md-9">
  13.                     <div class="masthead-categories">
  14.                         <?php if( have_rows('home_cat','option') ): ?>
  15.                             <?php while( have_rows('home_cat','option') ): the_row(); ?>
  16.                                 <h6><?php the_sub_field('section_name','option'); ?><br>
  17.                     <!-- по категории нужно сделать проверку и выводить только этой категории -->
  18.             <?php the_sub_field('section_sub_title','option'); ?></h6>
  19.                                 <div class="row row-flex">
  20.                                     <?php if( have_rows('link_items','option') ): ?>
  21.                                         <?php while( have_rows('link_items','option') ): the_row();?>
  22.                                             <div class="col-lg-15 col-sm-4 col-xs-6 col-xxs-12">
  23.                                             <?php
  24.                                                 $url = '';
  25.                                                 $target = '';
  26.                                                 if(get_sub_field('external_url','option')){
  27.                                                     $url = get_sub_field('external_url','option');
  28.                                                     $target = ' target="_blank"';
  29.                                                 } else {
  30.                                                     $url = get_sub_field('url','option');
  31.                                                 }
  32.                                                 $class = 'mast-cat-item';
  33.                                                 if ( get_sub_field( 'size_item','option') ) {
  34.                                                     $class .= ' mast-cat-item-small';
  35.                                                 }
  36.                                             ?>
  37.                                                 <a href="<?php echo esc_url($url);?>"<?php echo $target;?> class="<?php echo esc_attr( $class );?>">
  38.                                                     <span class="mast-cat-image">
  39.                                                         <span><?php if (get_sub_field('cat_image','option')) { ?>
  40.                                                             <img src="<?php echo wp_get_attachment_image_url( get_sub_field('cat_image','option'), 'medium' );?>" alt="<?php echo get_sub_field('link_name','option'); ?>">
  41.                                                         <?php } else { ?>
  42.                                                             <?php the_sub_field('font_icon','option'); ?>
  43.                                                         <?php } ?>
  44.                                                         </span>
  45.                                                     </span>
  46.                                                     <span class="mast-cat-name">
  47.                                                         <span><?php the_sub_field('link_name','option'); ?></span>
  48.                                                     </span>
  49.                                                 </a>
  50. <?php if( get_sub_field('link_name_2') ): ?>
  51. <div>
  52. <span class="mast-cat-name2">
  53. <a href="<?php the_sub_field('link_name_2_url','option'); ?>"
  54. style="position: absolute;
  55.     text-align: center;
  56.     background: #e30a2d;
  57.     padding: 1px 23px;
  58.     color: white;
  59.     border-radius: 5px;
  60. left: calc(50% - 67px);
  61.     bottom: -12px;
  62. "><?php the_sub_field('link_name_2','option'); ?></a>
  63. </span>
  64. </div>
  65. <?php endif; ?>
  66.                                             </div>
  67.                                         <?php endwhile; ?>
  68.                                     <?php endif; ?>
  69.                                 </div>
  70.                             <?php endwhile; ?>
  71.                         <?php endif; ?>
  72.                     </div>
  73.                 </div><!-- .col-xx-n -->
  74.                 <div class="col-md-3 mobhide">
  75.                     <?php get_sidebar(); ?>
  76.                     <?php echo wp_social_menu(array('header-social-menu'));?>
  77.                 </div><!-- .col-xx-n -->
  78.             </div><!-- .row -->
  79.         </div><!-- .container -->
  80.     </div>
  81. </section>
  82. <!-- End Masthead -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement