分类: 其他平台
2014-07-14 10:34:24
Chris, I’d like to add the code to my header.php but when I look at the exisiting code I’m a bit confused.
I would imagine I’m replacing the existing line that currently shows:
$title = ”;
if (is_single() ) $title = get_option(‘mandigo_title_scheme_single’);
elseif (is_page() ) $title = get_option(‘mandigo_title_scheme_page’);
elseif (is_archive()) {
if (is_day() is_month() is_year()) $title = get_option(‘mandigo_title_scheme_date’);
else $title = get_option(‘mandigo_title_scheme_category’);
}
elseif (is_search() ) $title = get_option(‘mandigo_title_scheme_search’);
else $title = get_option(‘mandigo_title_scheme_index’);
$title = str_replace(‘%blogname%’,get_bloginfo(‘name’) ,$title);
$title = str_replace(‘%tagline%’ ,get_bloginfo(‘description’),$title);
$title = str_replace(‘%post%’ ,get_the_title() ,$title);
$title = str_replace(‘%search%’ ,$s ,$title);
if (single_cat_title(”,false)) $title = str_replace(‘%category%’,single_cat_title(”,false) ,$title);
else $title = preg_replace(“/]+>/”,””,str_replace(‘%category%’,get_the_category_list(‘, ‘),$title));
if (is_day() ) $title = str_replace(‘%date%’,get_the_time(__(‘l, F jS, Y’,’mandigo’)),$title);
elseif (is_month()) $title = str_replace(‘%date%’,get_the_time(__(‘F, Y’,’mandigo’)) ,$title);
elseif (is_year() ) $title = str_replace(‘%date%’,get_the_time(‘Y’) ,$title);
echo $title;
?>
But… I’m not sure if I just replace the relevant line or the lot?
Sory to be so thick but any advice would be gratefully received.
Thanks