Snippets Archive

Codes that are meant to be useful for others. Commercial use of my code strictly prohibited.

Add Custom Column on Post Admin Panel

By default you would see some basic column (title, date, author, category, tags etc.) on Post administration panel in WordPress ...

Displaying List of Most Viewed Posts

On my last post, I wrote custom functions to display the post views in WordPress without any plugin. As promised, in this post I will show you how to display number of posts based on the post views count ...

Adding Post Views Count in WordPress

There are quite a few plugins out there than can keep the post views count in WordPress. However, you may have known by now that I don't like using Plugin ...

Adding Custom Dashboard Widget

By default, you would see quite a few Widgets (Quick Draft, At a Glance etc.) on "Dashboard" section of your WordPress site ...

Adding Excerpts to Pages in WordPress

Being able to display post excerpt is a very useful feature in WordPress. This can also be used to display dynamic content on meta tag for better SEO purpose ...

Removing URL Field from Comment Form

By default there is a URL input field in WordPress comment system. The input data of this field eventually links the commenter's name and appears as a live link as soon as the comment becomes approved ...

Removing "Title" Attribute from Menu Link

If you are a WordPress theme developer or designer, you know how distracting it is when the "title" tooltip pops up while hovering through menu items ...

Disable "Add Media" Button for Everyone but Admin

Recently I was working on a project where I was suppose to disable the "Add Media" button for authors from the post editing window, so that they can't upload the image on the posts ...

Registering Custom Taxonomy in WordPress

In one of my tutorial post, I showed how to register a Custom Post Type (CPT) in WordPress. Now, if you want to make it little more interesting and want to add "Categories" just like the regular blog posts, you can easily do that simply registering a taxonomy and assigning it to be used for your desired CPT ...

Removing a User Role in WordPress

Capability of adding custom role in WordPress is one of many WordPress features that I fell in love with ...

Adding Custom User Role in WordPress

Adding custom user role in WordPress is as easy as it can get. You can pretty much add as many roles as you want and assign various capabilities depending on your requirements ...