mimko
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Broken calendar linksI had the same problem, so I played around with the templates-functions-links.php file (found in wp-includes directory) and changed:
function get_day_link($year, $month, $day) {
global $querystring_start, $querystring_equal;
if (!$year) $year = gmdate(‘Y’, time()+(get_settings(‘gmt_offset’) * 3600));
if (!$month) $month = gmdate(‘m’, time()+(get_settings(‘gmt_offset’) * 3600));
if (!$day) $day = gmdate(‘j’, time()+(get_settings(‘gmt_offset’) * 3600));
if (” != get_settings(‘permalink_structure’)) {
$off = strpos(get_settings(‘permalink_structure’), ‘%day%’);
$offset = $off + 6;
$daylink = substr(get_settings(‘permalink_structure’), 0, $offset);
if (‘/’ != substr($daylink, -1)) $daylink = substr($daylink, 0, -1);
$daylink = str_replace(‘%year%’, $year, $daylink);
$daylink = str_replace(‘%monthnum%’, zeroise(intval($month), 2), $daylink);
$daylink = str_replace(‘%day%’, zeroise(intval($day), 2), $daylink);
$daylink = str_replace(‘%post_id%’, ”, $daylink);
return get_settings(‘home’) . $daylink;
} else {
return get_settings(‘home’) .’/’. get_settings(‘blogfilename’) .$querystring_start.’m’.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2);
}
}to the following:
function get_day_link($year, $month, $day) {
global $querystring_start, $querystring_equal;
if (!$year) $year = gmdate(‘Y’, time()+(get_settings(‘gmt_offset’) * 3600));
if (!$month) $month = gmdate(‘m’, time()+(get_settings(‘gmt_offset’) * 3600));
if (!$day) $day = gmdate(‘j’, time()+(get_settings(‘gmt_offset’) * 3600));
if (” != get_settings(‘permalink_structure’)) {
$off = strpos(get_settings(‘permalink_structure’), ‘%day%’);
$offset = $off + 6;
$daylink = substr(get_settings(‘permalink_structure’), 0, $offset);
if (” != substr($daylink, -1)) $daylink = substr($daylink, 0, -1);
$daylink = str_replace(‘%year%’, $year, $daylink);
$daylink = str_replace(‘%monthnum%’, zeroise(intval($month), 2), $daylink);
$daylink = str_replace(‘%day%’, zeroise(intval($day), 2), $daylink);
$daylink = str_replace(‘%post_id%’, ”, $daylink);
return get_settings(‘home’) . $daylink;
} else {
return get_settings(‘home’) .’/’. get_settings(‘blogfilename’) .$querystring_start.’m’.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2);
}
}All I did was get rid of a ‘/’ in the line:
if (‘/’ != substr($daylink, -1)) $daylink = substr($daylink, 0, -1);