Advertisement
rejuancse

template

Jan 23rd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.80 KB | None | 0 0
  1. <?php
  2. /*
  3.  * Template Name: Tournaments
  4.  */
  5. get_header();
  6. ?>
  7.  
  8. <section id="main">
  9.     <div class="container">
  10.         <div class="row">
  11.             <?php get_template_part('lib/sub-header'); ?>
  12.  
  13.             <?php $filters = get_terms('tournament');
  14.  
  15.             $coun_item = 1;
  16.             $filters = array_values($filters);
  17.  
  18.  
  19.  
  20.             foreach ($filters as $key=>$filter) {
  21.  
  22.                 $term_link = get_term_link( $filter );
  23.  
  24.                 $tournament_year    = get_term_meta ( $filter->term_taxonomy_id, 'tournament_year', true );
  25.                 $image_id           = get_term_meta ( $filter->term_taxonomy_id, 'taxonomy-logo-image-id', true );
  26.                 $bg_image           = get_term_meta ( $filter->term_taxonomy_id, 'taxonomy-bg-image-id', true );
  27.                 $options_tour       = get_term_meta ( $filter->term_taxonomy_id, 'options_tour', true );
  28.  
  29.  
  30.                 // echo $options_tour;
  31.  
  32.                 // print_r($options_tour);
  33.  
  34.  
  35.                 ?>
  36.                
  37.                  
  38.                 <div class="col-sm-6">  
  39.                 <div class="thm-tournament">  
  40.                     <?php if ( $image_id ) { ?>
  41.                     <div class="logo-img"><?php echo wp_get_attachment_image ( $image_id, 'thumbnail' ); ?></div>
  42.                     <?php } ?>
  43.                     <?php if ( $bg_image ) { ?>
  44.                     <div class="bg-img"><?php echo wp_get_attachment_image ( $bg_image, 'calcio-highlight-small' ); ?></div>
  45.                     <?php } ?>
  46.  
  47.                     <div class="overlay">
  48.                         <h2><a href="<?php echo $term_link; ?>"><?php echo $filter->name ?></a></h2>
  49.                         <p><?php echo $filter->description ?></p>
  50.                         <p><?php echo $tournament_year; ?></p>
  51.                         <p><?php echo 'count: '. $filter->count; ?></p>
  52.                     </div>
  53.                 </div>          
  54.                 </div>          
  55.                          
  56.             <?php } ?>
  57.            
  58.         </div> <!--/#content-->
  59.     </div>
  60. </section> <!--/#main-->
  61. <?php get_footer(); ?>
  62.  
  63.  
  64. <style type="text/css">
  65.    
  66.     .logo-img {
  67.     width: 90px;
  68.     height: 90px;
  69.     position: absolute;
  70.     text-align: center;
  71.     transform: translate(-50%, 50%);
  72.     left: 23%;
  73.     background: #fff;
  74.     border-radius: 50%;
  75. }
  76. .logo-img img.attachment-thumbnail.size-thumbnail {
  77.     width: 62px;
  78.     height: 62px;
  79.     margin-top: 13px;
  80.     text-align: center;
  81. }
  82.  
  83. .bg-img {
  84.     float: left;
  85.     margin-right: 20px;
  86. }
  87. .thm-tournament{
  88.     background: #fff;
  89.     margin: 0;
  90.     padding: 0;
  91.     box-shadow: 0 2px 13px 0 rgba(0,0,0,0.04);
  92.     height: 187px;
  93.     display: block;
  94.     overflow: hidden;
  95.     margin-bottom: 30px;
  96. }
  97. .overlay h2 {
  98.     font-size: 20px;
  99. }
  100.  
  101. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement