by Shashi Dhar Kumar | Mar 11, 2012 | Open-Source, Programming, 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...
by Shashi Dhar Kumar | Feb 10, 2012 | PHP, Programming, Unix OS
How to redirect web based page with .htaccess Following are the code to paste (be careful to write on .htaccess it can be messed up whole website if anything goes wrong) into .htaccess file 301 redirection for any domain : RewriteEngine On RewriteCond %{HTTP_HOST}...
by Shashi Dhar Kumar | Feb 10, 2012 | Programming
Following are the detault pages for website of technology based : 1) HTML Based default pages : a) index.htm b) index.html c) default.htm 2) PHP Based default pages : a) index.php 3) SHTML Based default pages : a) index.shtml 4) Classic ASP Based default pages : a)...
by Shashi Dhar Kumar | Feb 18, 2011 | Open-Source, PHP, Programming
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...
by Shashi Dhar Kumar | Feb 16, 2011 | Open-Source, PHP, Programming
Get a File name from url Using PHP Get the “filename”, or the last part of the string, with the basename function. <?php $url = ‘http://www.example.com/feeds/xyz/index.php?filename=abc’; echo basename($url); // print “index.php”; ?>...