Wednesday, May 23, 2012

Change date to timestamp PHP

Change normal date to timestamp

$timestamp = strtotime(date("D M d, Y G:i:s a"));

Hack google-sitemap-generator for my custom sitemaping

Just Open Your google-sitemap-generator Plugin Directory. And open sitemap-core.php file

find this :-

$this->AddUrl($page->GetUrl(), $page->getLastMod(),$page->getChangeFreq(),$page->getPriority());

And Below after ending second '}' (Curlibraces) you write down your code like that:-

$rows = $wpdb->get_results( "SELECT id, last_access FROM TABLE ORDER BY id ASC" );
foreach($rows as $row) :
$the_page = get_page_by_title( 'PAGE_TITLE' );
$GetUrl = add_query_arg(array('id' => $row->id), get_permalink($the_page->ID));
$lastMod = strtotime($row->last_access);
$this->AddUrl($GetUrl, $lastMod, 'Weekly', 0.6);
endforeach;