Latest NewsBlog Detail

Single Post

How to get a List of Post Tags in WordPres

How to get a List of Post Tags in WordPress

Are you looking for a way to display tags in an HTML list? This snippet will display your website’s tags in an unordered list with items that link to the corresponding tag page.

Instructions:

Simply copy and paste the following code wherever you want your tags to appear in your theme files. For further reading see the get_tags codex.

<?
    $tags = get_tags();
    if ($tags) {
        ?><ul class="tags"><?
        foreach ($tags as $tag) {
            echo '<li><a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a></li>';
        }
        ?></ul><?
    }
?>

 

Tags
Sarker Allex
Sarker Allex

Co-Founder & Director at Prokash IT

Provesh is Co-Founder and Director at Proveshit. He is responsible for managing, growing open source technologies team and has spearheaded more than 250 projects in Salesforce CRM alone. He provides consulting and advisory to clients looking for services relating to CRM(Customer Relationship Management) and ECM(Enterprise Content Management). In the past, Pratyush has held consulting roles with various global technology leaders, such as Globallogic & HCL in Bangladesh. He holds an Engineering graduate degree from Bangladesh Institute of Technology, Roorkee.