Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8732
  • 博文数量: 19
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 210
  • 用 户 组: 普通用户
  • 注册时间: 2014-07-10 09:52
文章分类
文章存档

2014年(19)

我的朋友
最近访客

分类: 其他平台

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

阅读(86) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~