Category / PHP

We have to use a little trick! In other words, we will remove the meta box and then we will add a new one again:

Read More

Many developers use the HTML comment in order to analyse the page by using the “view source” feature provided by almost all browsers. However, these comments will be visible to everyone. Also, they are sent from the server to the client and that could take a lot of needless bytes. If you don’t need to […]

Read More

If you have used a custom query ( for example with query_posts()) before standard WordPress flow, you might reset the internal query to avoid the strange result in the sidebar or other sides:

Read More

In WordPress, you can organise the category with a relationship parent/child. This means that a single post belongs to multiple categories. Let’s see how to get the parent category of a post:

Read More

Sometimes, you may wish to check a POST variable and when it is not set then get a default value. The first approach could be:

Read More

Administrator or subscriber? Let’s see a quick way to check it! Shorter Of course, you can check also the rest of WordPress roles, such as “subscriber” for example.

Read More

Let’s see how to convert a date from yyyy-mm-dd hh:mm:ss to yyyymmddhhmmss. This can be useful when you’ll use sort functions for example (such as asort()). Elegant: Obvious: Insane:

Read More