
打开主题下的 functions.php 文件,在最后添加如下代码,将内容修改成你想要的样子。
代码如下:
<pre>function feed_copyright($content) {
if(is_single() or is_feed()) {
$content.= "<p class='crinfo'>";
$content.= '» 版权所有:<a title="owoer" href="http://www.iswz.net/">Themeidea</a> » <a rel="bookmark" title="'.get_the_title().'" href="'.get_permalink().'">......

function ForStrdate ($time) {
$now = time();
$interphase = $now - $time ;
$return = '';
if ( $interphase >= 0) {
$temp = $interphase/60;
if ($temp < 60) {
if (floor($temp) == 0) {
$return = '刚刚';
} else {
$return = floor($temp).'分钟前';
}
}elseif ($temp < 3600) {
$return = floor($temp/60).'小时前';
}elseif ($temp < 43200) {
$return = floor($temp/(60*24)).'天前';
}else {
$return = date('Y年m月d日',$time);
}
} els......
作者: owoer
|
发表于:2012年8月29日
|
栏目:PHP
|
php时间显示几分钟前几天前已关闭评论
阅读全文

将以下代码贴入主题的function.php文件:
//缩略图获取
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 140, 98 ,true );//设置缩略图的尺寸
function dm_the_thumbnail() {
global $post;
// 判断该文章是否设置的缩略图,如果有则直接显示
if ( has_post_thumbnail() ) {
echo '<a href="'.get_permalink().'">';
the_post_thumbnail();
echo '</a>';
} else { //如果文章没有设置缩略图,则查找文章内是否包含图片
$content = $post->post_conte......

wordpress添加面包屑导航
编辑主题,在function.php文件里加上以下内容:
/*BREADCRUMB*/
function the_breadcrumb() {
if (!is_home()) {
echo '<a href="';
echo get_option('home');
echo '">';
echo "首页";
echo "</a> > ";
if (is_category() || is_single()) {
single_cat_title();
if (is_single()) {
the_category(', ');
echo " > ";
echo "正文";
}
} elseif (is_page()) {
echo the_title();
}
elseif (is_tag()) {
echo '......