Skip to content

Function PHP st_the_tags

Amaury Balmer edited this page Jun 17, 2013 · 1 revision

Description and usage

This feature extend WordPress builtin function "the_tags()", you can specify tag format, text if no tags and post id, also outside the loop If you don't want to show it, but use it, use st_get_the_tags() function.

Introduction

<?php st_the_tags(); ?>

Default Usage

'before' => __('Tags: ', 'simpletags'),
'separator' => ', ',
'after' => '<br />',
'post_id' => '',
'xformat' => __('<a href="%tag_link%" title="%tag_name%" %tag_rel%>%tag_name%</a>', 'simpletags'),
'notagtext' => __('No tag for this post.', 'simpletags'),
'number' => 0

Parameters

  • before
    • (string) Text to display before the actual tags are displayed. Defaults to Tags:
  • separator
    • (string) Text or character to display between each tag link. The default is a comma (,) between each tag.
  • after
    • (string) Text to display after the last tag. The default is to display nothing.
  • post_id
    • (integer) Specified post ID for display tag posts (outside loop by example)
  • xformat
    • (string) Extended format of links. You can personalize the formating of tag's link. Available markups :
      • tag_link - Replaced by the permalink of the tag
      • tag_feed - Replaced by the RSS tag link
      • tag_id - Replaced by the tag ID
      • tag_name - Replaced by the tag's name
      • tag_name_attribute - Replaced by the tag's name, formatted for attribute HTML
      • tag_rel - Replaced by rel tag markup (creates : rel="tag")
      • tag_technorati - Replaced by Technorati tag link
      • tag_flickr - Replaced by Flickr tag link
      • tag_delicious - Replaced by Del.ici.ous tag link
  • notagtext
    • (string) Text to show, if there is no tag.
  • number
    • (integer) Limit tags output with this max number