Category / PHP

When you are using a Custom Post Type with its Custom Post Taxonomies, you could need to detect if a particular category is displayed in a post. So, I write a simple WordPress shortocode you can use to detect a particular category and then display the content of the post. To achieve that, you can add […]

Read More

From PHP 5.3 we can use some amazing new interfaces so magical. One of them is ArrayAccess. This interface provides a set of methods that we can use to implement the array behavior in a stdClass.

Read More

MorrisJS is a simple Javascript library used to draw simple beautiful charts. It is based on Raphael Javascript library.

Read More

I love Laravel, and you? Overall, the Facades feature! When you use a facade like some Eloquent model, you have noticed the following case…

Read More

I spent a lot of time to translate my previous PHP code from cURL in Guzzle Http. So, beware because if you use Guzzle you have to use a request in multipart. For example, this was my previous code:

Read More

MySQL provides a very simple method to select rows in random order. It uses the ORDER BY RAND()statement. If you will be used theORDER BY RAND() statement, MySQL will create a temporary table with all results, then will be assigned a random index to each row and finally will return the random rows! This makes the […]

Read More

When you would like to show a page only for a specified user or you wish to create a maintenance page, you may use this simple script:

 

Read More

You remember the post How to get a page/post content, don’t you? Then, we may get the page/post content by:

Read More

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 most all browsers. However, these comments will be visible for 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