• Hello All,

    I was new to wordpress. In admin panel, I am adding tags to my pages. I want to show all the tags related to a page in the website. For example, If I open aboutus page, I want to show list of tags that are tagged to this page.

    Please help me.

    Thanks
    Charan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,
    Try below code where you want to show tags in your page.

    $args = array(
     'post_type' => 'page',
     'orderby' =>'date',
     'order' => 'DESC'
    );
    $query = new WP_Query($args);
    if($query->have_posts()):
      while($query->have_posts()):
        $query->the_post();
    ?>
    <a href="<?php the_permalink();?>">
      <?php the_title(); ?>
    </a>
    <?php
         the_title()
      endwhile;
      wp_reset_postdata();
    endif;

    Let me know if it doesn’t work
    Thanks.

    Sorry,
    I write to show the title two time. Remove the second the_title() from that code.
    Thanks

    Thread Starter digicharan

    (@digicharan)

    Hi,

    Thank you.

    But the code which you provided is displaying list of all pages. I want to show list of tags related to the page.

    Thanks
    Charan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to display tags on a page in a website’ is closed to new replies.