How to Link Widget Titles in WordPress without using a plugin

By default WordPress does not accept hyperlinks in the widget title.  Even if you enter a hyperlink , it will strip down all the html tags  and simply print out the text.  So basically in order to link the widget titles, we’ll need to find a way to make WordPress accept html in Widget Title.

The Snippet

Here is a little snippet which lets you add a hyperlink in the widget title. The snippet  makes use of widget_title filter and it will dynamically replace custom tags with actual html tags. You can use the Code Snippet plugin to run this piece of code.

Read moreHow to Link Widget Titles in WordPress without using a plugin

How to Add Custom JavaScript to a Specific Page in WordPress

In this tutorial I will share a simple technique to add custom JavaScript to a specific Page in WordPress. The best part is that we don’t need to make any edits to the templates files or the functions.php file.

The Concept

The Concept behind this tutorial is quite simple. We will make use of Custom Fields to add custom js. Here is what we will be doing

  • We will first create a custom field to hold the JavaScript code
  • We will then simply output the value of custom field on the respective Page

Simple, isn’t it? Lets start!!

Read moreHow to Add Custom JavaScript to a Specific Page in WordPress

How to Add Google Analytics to WordPress Admin Panel

Recently I was in a situation where I wanted to track the Pageviews for the admin panel.  Since I use Google Analytics on all my websites, I decided to add it  to all the admin pages.

Since there are no plugins to specifically add google analytics code to admin pages, I wrote a short snippet.

In case you also want to add google analytics to your admin panel , here are the instructions. 

Read moreHow to Add Google Analytics to WordPress Admin Panel

Display Business Hours in WordPress Sidebar

A lot of Service Business like Spa , Salon , Restaurants etc.  display Opening / Working Hours on their website. In this Post I will share a simple snippet to add Working / Business Hours to the WordPress SideBar.

We will utilize the all powerful WordPress Text Widget to display the business Hours.  Since the Text Widget Supports HTML , it is a matter of pasting an html snippet to display Business Hours.

Read moreDisplay Business Hours in WordPress Sidebar

A Simple Guide to Customizing the WordPress Admin ToolBar

A lot of people have Love-hate relationship with the WordPress Admin Toolbar. I personally love the toolbar as it makes life easy for me. I spend a lot of time working with WordPress and would simply go mad it there is no toolbar. It makes super easy to switch between the Front end and the Back End.

However there might be some cases where you might want to customize or all together remove the toolbar.  For example you might encounter a situation where you want to disable toolbar based on user roles. In this post I cover a few techniques which can be used to customize the WordPress Admin ToolBar. In other

More specifically I will cover the following use cases.

  • Disable Admin Bar for all users
  • Disable admin bar based on user roles
  • Display Admin Toolbar to Logged Out Users
  • Add / Remove Custom Menu Item / Links  to Admin ToolBar

Read moreA Simple Guide to Customizing the WordPress Admin ToolBar

How to Turn Off Comments on WordPress Pages

In this tutorial I will share a simple snippet which allows you to disable / turn Off comments on WordPress Pages.

The snippet is quite simple and does two things

1) It first checks if the post is of type ‘page’. The check is done after the post object is completely created.

2) In case the post belongs to disabled category, the code uses comments_open() filter to close the comments on the page.

Read moreHow to Turn Off Comments on WordPress Pages