Posts Tagged "function"

How to disable posts auto save in WordPress?

WordPress have a very useful function that auto-saves your posts while you’re typing them in the dashboard. Though, if for some reason you’d like to disable this function, it is very easy to do. Just read on! To disable WordPress…

Like to share it
Read More

How to add custom post type in wordpress

Open “function.php” add the following code to add new custom post type : <?php add_action(‘init’, ‘featured_post_register’); function featured_post_register() { $labels = array( ‘name’ => _x(‘Featured Posts’, ‘post type general name’), ‘singular_name’ => _x(‘Featured Posts’, ‘post type singular name’), ‘add_new’ =>…

Like to share it
Read More

Get the First Monday of the current Month or Get Last Day of Month or Get First Day of Month

Get the First Monday of the current Month or Get Last Day of Month or Get First Day of Month Get the First Monday of the current Month <?php function getFirstMonday($month,$year) { $num = date(“w”,mktime(0,0,0,$month,1,$year)); if($num==1) return date(“Y-M-ds”,mktime(0,0,0,$month,1,$year)); elseif($num>1) return…

Like to share it
Read More

Wordwrap your text

Here the function that comes under php i.e wordwrap(). You can use it for wrapping you long string text into multiple lines and easy to read. Following are the code that help you. Copy and paste the code into your…

Like to share it
Read More

Substr () PHP Function

The Substr () PHP Function is used to return part of a string. It is written as substr (string, start, optional length);.The string is whatever string you want to return a portion of. The start is how many characters in…

Like to share it
Read More

Difference between isset empty is null

I have come across code that checks for empty or null values, or if a variable is set. Many of these checks fail as the wrong function is being used to assert the correct value. While it is important to…

Like to share it
Read More