PHP Classes

File: elements/tags_container.php

Recommend this page to a friend!
  Classes of Victor Andeloci   One WordPress Game Theme   elements/tags_container.php   Download  
File: elements/tags_container.php
Role: Example script
Content type: text/plain
Description: Example script
Class: One WordPress Game Theme
WordPress theme for a gaming blog and podcast
Author: By
Last change:
Date: 1 year ago
Size: 626 bytes
 

Contents

Class file image Download
<div class="tags-container">
  <?php
    $i
= 0;
   
$tags = get_the_tags((!empty($args['post_id']) ? $args['post_id'] : get_the_ID()));
    if (
$tags) :
      foreach (
$tags as $tag) :
        if (
$i <= 2 || is_single()) :
 
?>
<a
            href="<?= get_home_url() ?>/tag/<?= str_replace(' ', '-', iconv('UTF-8', 'ASCII//TRANSLIT', $tag->name)) ?>"
            tag="<?= str_replace(' ', '-', iconv('UTF-8', 'ASCII//TRANSLIT', $tag->name)) ?>"
            class="tag"
          >
            #<?= $tag->name ?>
</a>
  <?php
          $i
++;
        endif;
      endforeach;
    endif;
 
?>
</div>