Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The secton Masthead
- */
- ?>
- <!-- Masthead -->
- <section id="masthead" class="masthead">
- <div class="section-home-cats">
- <div class="container">
- <div class="row">
- <div class="col-md-9">
- <div class="masthead-categories">
- <?php if( have_rows('home_cat','option') ): ?>
- <?php while( have_rows('home_cat','option') ): the_row(); ?>
- <h6><?php the_sub_field('section_name','option'); ?><br>
- <!-- по категории нужно сделать проверку и выводить только этой категории -->
- <?php the_sub_field('section_sub_title','option'); ?></h6>
- <div class="row row-flex">
- <?php if( have_rows('link_items','option') ): ?>
- <?php while( have_rows('link_items','option') ): the_row();?>
- <div class="col-lg-15 col-sm-4 col-xs-6 col-xxs-12">
- <?php
- $url = '';
- $target = '';
- if(get_sub_field('external_url','option')){
- $url = get_sub_field('external_url','option');
- $target = ' target="_blank"';
- } else {
- $url = get_sub_field('url','option');
- }
- $class = 'mast-cat-item';
- if ( get_sub_field( 'size_item','option') ) {
- $class .= ' mast-cat-item-small';
- }
- ?>
- <a href="<?php echo esc_url($url);?>"<?php echo $target;?> class="<?php echo esc_attr( $class );?>">
- <span class="mast-cat-image">
- <span><?php if (get_sub_field('cat_image','option')) { ?>
- <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'); ?>">
- <?php } else { ?>
- <?php the_sub_field('font_icon','option'); ?>
- <?php } ?>
- </span>
- </span>
- <span class="mast-cat-name">
- <span><?php the_sub_field('link_name','option'); ?></span>
- </span>
- </a>
- <?php if( get_sub_field('link_name_2') ): ?>
- <div>
- <span class="mast-cat-name2">
- <a href="<?php the_sub_field('link_name_2_url','option'); ?>"
- style="position: absolute;
- text-align: center;
- background: #e30a2d;
- padding: 1px 23px;
- color: white;
- border-radius: 5px;
- left: calc(50% - 67px);
- bottom: -12px;
- "><?php the_sub_field('link_name_2','option'); ?></a>
- </span>
- </div>
- <?php endif; ?>
- </div>
- <?php endwhile; ?>
- <?php endif; ?>
- </div>
- <?php endwhile; ?>
- <?php endif; ?>
- </div>
- </div><!-- .col-xx-n -->
- <div class="col-md-3 mobhide">
- <?php get_sidebar(); ?>
- <?php echo wp_social_menu(array('header-social-menu'));?>
- </div><!-- .col-xx-n -->
- </div><!-- .row -->
- </div><!-- .container -->
- </div>
- </section>
- <!-- End Masthead -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement