Viewing 6 replies - 1 through 6 (of 6 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    You can use any of the following function to display post tags.

    <?php the_tags( $before, $sep, $after ); ?>

    Document:- https://codex.www.ads-software.com/Function_Reference/get_the_tag_list

    <?php wp_get_post_tags( $post_id, $args ) ?>

    Document:- https://codex.www.ads-software.com/Function_Reference/wp_get_post_tags

    Thread Starter spching2006

    (@spching2006)

    Hi, I read the documentation given but i don’t see where it stated to put the code.
    Can you help to clarify? Should I put in the functions.php file? or which file?

    AddWeb Solution

    (@addweb-solution-pvt-ltd)

    You put the below code in your either template file, single.php or page.php as it depends on where you want to list out Tags. So, you can get post’s all tag list.

    <?php
      $postId = get_the_ID(); // get current post id. you can set id of post of which you want to get Tags
      the_terms( $postID,'','');
    ?>
    Thread Starter spching2006

    (@spching2006)

    I just placed it under the single.php but no tag appear at all. Do you know why?

    AddWeb Solution

    (@addweb-solution-pvt-ltd)

    @spching2006,

    Following way to Display the all tag of the particular post.

    1) If you can below code to Dispaly the tag. So put the below code in your either template file, single.php or page.php as it depends on where you want to list out Tags

    <?php the_tags(); ?>

    Reference: the_tags()

    2) If you can use below code to display the tag, so you can put below code in your function.php file.

    <?php
    // get current post id. you can set id of post of which you want to get Tags
    $postId = get_the_ID();
    the_terms( $postId,'','');
    ?>

    Hi I’d like to know about this too.

    I can’t get tags or categories listed in a project post. Shouldn’t they just display as standard?

    I tried some of the above—very nervously—without any luck.

    John

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Displaying Tags at the bottom of each Post’ is closed to new replies.