LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » WordPress / WordPress Snippets » How To Pick Most Used Tags In WordPress Without A Plugin?

How To Pick Most Used Tags In WordPress Without A Plugin?

Pick-Most-Used-Tags-In-WordPress-Without-A-Plugin
WordPress is a full features CMS platform and due to based upon PHP, its more functionable. As you know that there are many plugins available for every use of WordPress but plugins can create a very harsh result to your WordPress blog and also can compromise your security so you have to use less plugins and only top developers plugin to keep your blog safe.

So now we have a little WordPress snippet that will pick your most fills tags that have maximum posts in it and make a list of them. You can also limit that how many tags you want to pick and show. Its very easy and good for template designed and a good sidebar widget that will be also valuable and will keep your space clear of new tags that have min posts and useless to view on sidebar or footer.

So now without any more preface, pick the snippet and add it where you want to show and customize it with your desire.

Features:

1.) Pure PHP Code.
2.) No Plugin.
3.) Quick To Load.
4.) Work On Every Page.
5.) Will Not Work Inside WP Loop.
6.) Two Piece Of Code.
7.) Fully Customizable.
8.) No Conflicting.
9.) Pick Most Post Category.
10.) Best For Sidebar And Footer

<!-- Start Limited List Of Most Used Tags -->
<?php
function top_tags() {
 $tags = get_tags();
 if (empty($tags))
 return;
 $counts = $tag_links = array();
 foreach ( (array) $tags as $tag ) {
 $counts[$tag->name] = $tag->count;
 $tag_links[$tag->name] = get_tag_link( $tag->term_id );
 }
 asort($counts);
 $counts = array_reverse( $counts, true );
 $i = 0;
 foreach ( $counts as $tag => $count ) {
 $i++;
 $tag_link = clean_url($tag_links[$tag]);
 $tag = str_replace(' ', '&nbsp;', wp_specialchars( $tag ));
 if($i < 11){
 print "<li><a href=\"$tag_link\">$tag ($count)</a></li>";
 }
 }
}
?>
<ul>
<?php top_tags(); ?>
</ul>
<!-- End Limited List Of Most Used Tags -->

Customization:

Change 11 with your desired no of tags that you want to pic. Always add 1 more as 11 mean that to pick only top 10 tags.

Last Words:

This is what we have and shared in easy steps for newbies so that they can easily know how it works. Stay with us because we are going to share a whole guide step by step about WordPress and make it easy for you. If you liked it then share it and be with us to get next tutorial. If you have any problem then feel free to ask us. We will help you with what we can or have.

You Like It, Please Share This Recipe With Your Friends Using...

2 Responses to “How To Pick Most Used Tags In WordPress Without A Plugin?”

  1. WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL. Features include a plugin architecture…. Amazing here

Leave a Reply

Your email address will not be published. Required fields are marked *