vyspirit

post tag

Apr 23rd, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2.     if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  3.     wp_reset_postdata();
  4.    
  5.     //get post settings
  6.     $ot_post = composs()->posts;
  7.  
  8.     //post tags
  9.     $posttags = get_the_tags();
  10.     $tagCount = count($posttags);
  11.  
  12. ?>
  13.    <?php if( $posttags  && $ot_post->compare( get_the_ID(), 'post_tag_single','post_tag' ) == "1" ) { ?>
  14.         <div class="composs-tag-list">
  15.             <?php  
  16.                 $i = 1;
  17.                 foreach($posttags as $tag) {
  18.                     echo '<a href="'.esc_url(get_tag_link($tag->term_id)).'">'.$tag->name . '</a>';
  19.                     //if($tagCount!=$i) { echo ", "; }
  20.                     $i++;
  21.                 }
  22.             ?>
  23.         </div>
  24.     <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment