Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Template Name: Tournaments
- */
- get_header();
- ?>
- <section id="main">
- <div class="container">
- <div class="row">
- <?php get_template_part('lib/sub-header'); ?>
- <?php $filters = get_terms('tournament');
- $coun_item = 1;
- $filters = array_values($filters);
- foreach ($filters as $key=>$filter) {
- $term_link = get_term_link( $filter );
- $tournament_year = get_term_meta ( $filter->term_taxonomy_id, 'tournament_year', true );
- $image_id = get_term_meta ( $filter->term_taxonomy_id, 'taxonomy-logo-image-id', true );
- $bg_image = get_term_meta ( $filter->term_taxonomy_id, 'taxonomy-bg-image-id', true );
- $options_tour = get_term_meta ( $filter->term_taxonomy_id, 'options_tour', true );
- // echo $options_tour;
- // print_r($options_tour);
- ?>
- <div class="col-sm-6">
- <div class="thm-tournament">
- <?php if ( $image_id ) { ?>
- <div class="logo-img"><?php echo wp_get_attachment_image ( $image_id, 'thumbnail' ); ?></div>
- <?php } ?>
- <?php if ( $bg_image ) { ?>
- <div class="bg-img"><?php echo wp_get_attachment_image ( $bg_image, 'calcio-highlight-small' ); ?></div>
- <?php } ?>
- <div class="overlay">
- <h2><a href="<?php echo $term_link; ?>"><?php echo $filter->name ?></a></h2>
- <p><?php echo $filter->description ?></p>
- <p><?php echo $tournament_year; ?></p>
- <p><?php echo 'count: '. $filter->count; ?></p>
- </div>
- </div>
- </div>
- <?php } ?>
- </div> <!--/#content-->
- </div>
- </section> <!--/#main-->
- <?php get_footer(); ?>
- <style type="text/css">
- .logo-img {
- width: 90px;
- height: 90px;
- position: absolute;
- text-align: center;
- transform: translate(-50%, 50%);
- left: 23%;
- background: #fff;
- border-radius: 50%;
- }
- .logo-img img.attachment-thumbnail.size-thumbnail {
- width: 62px;
- height: 62px;
- margin-top: 13px;
- text-align: center;
- }
- .bg-img {
- float: left;
- margin-right: 20px;
- }
- .thm-tournament{
- background: #fff;
- margin: 0;
- padding: 0;
- box-shadow: 0 2px 13px 0 rgba(0,0,0,0.04);
- height: 187px;
- display: block;
- overflow: hidden;
- margin-bottom: 30px;
- }
- .overlay h2 {
- font-size: 20px;
- }
- </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement