How to Fix: WordPress database error Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO `wp_usermeta`

August 21st, 2019 by

Recently, when I was playing with the multisite feature of WordPress I came across this error I understand that there is some problem in the database table wp_usermeta. Well, actually what I was trying to do is to convert my present wordpress single site to multisite. And during this process I suddenly started getting this […]

How to customize dashboard by removing unnecessary menu or widgets

October 3rd, 2016 by

When creating a user based wordpress website, it is important to remove all the unnecessary information from the website. Although assigning capabilities does most of the job for you. Actually ‘capabilities’ is the most important part because it makes sure that users don’t access pages that they are not supposed to. But coming back to […]

How to add single category posts template to your wordpress theme

September 28th, 2016 by

Recently, I was implementing a private site in wordpress. So, I wanted to give privilege to some users only to be able to read posts under a certain category say¬† ‘news’ . But according to wordpress template hierarchy only categories can have separate templates by using category-{slug}.php But there is a way out for single-{category-slug}.php […]

How to add WPML Language Code to body class

August 20th, 2016 by

In various scenarios it is very much required to show/hide few things in different language using CSS/Javascript. The most handy way I found is to add language code to the body class. But how do we do that? I am using WPML for different languages, so they provide a Simple PHP Code ICL_LANGUAGE_CODE . Add […]

How to hide titles with empty menu in widgets

August 19th, 2016 by

Scenario: It can be possible with multiple language website. When you have a menu in one language but not in another.

Solution to it is very simple. Hide it using JQuery