Dec 09
看到挺多人的博客都给自己的Wordpress增加了一个独立的友情链接页面,google了一下,发现关于如何增加独立友情链接页面出来的结果很多,却都是出自一个源头,转来转去,也不留出处,汗一个……不过因为这个模板是自己瞎捣鼓的,网上的方法实践了一下却不能成功添加,看了一下wordpress的代码才发现必须增加一个pagetemplate的php文件,这里把具体步骤记录一下:
①、在自己的模板下找到pagetemplate.XXXXXXXXX.php的文件,我的模板下有pagetemplate.simpletagging.php,pagetemplate.tagcloud.php,pagetemplate.tagtabs.php,直接复制一个,注意修改头部名字,Template Name:links,格式和下面1,2,3行保持一致!
1: <?php
2: /*
3: Template Name: links
4: */
5: ?>
6: <?php
7: get_header();
8: ?>
9:
10: <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
11: <div class=“post” id=“post-<?php the_ID(); ?>”>
12: <h3 class=“storytitle”><a href=“<?php the_permalink() ?>” rel=“bookmark”><?php the_title(); ?></a></h3>
13:
14: <?php the_content(”); ?>
15: <?php get_links_list(); ?>
16:
17: </div>
18:
19: <?php endwhile; else: ?>
20: <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
21: <?php endif; ?>
22:
23: <?php posts_nav_link(‘ — ‘, __(‘« Older Posts’), __(‘Newer Posts »’)); ?>
24:
25: <?php get_footer(); ?>
②、如果希望links页面可以留言,那在上面18行添加:<?php comments_template(’links.php’); // Get wp-comments.php template ?>,这里如果使用默认评论的话,直接用:<?php comments_template(); ,不需要参数,links.php从single.php(独立文章页)复制,改文件名为links.php或者自己喜欢的名字
③、增加一个page,标题为“友情链接”或“links”,内容随便写自己想写的,例如“欢迎在此申请友情链接”等,“page template ”(也就是模板页)选择”links”,页面缩略名填“friendlinks”(可省略),搞定了~~~

December 10th, 2007 at 12:21 pm
很不错 但是对我没有用 呵呵
December 10th, 2007 at 12:25 pm
其实友情链接不多的话没什么必要再专门添加一个页面
准备把这些page移到Head上去
December 10th, 2007 at 12:50 pm
现在都很少人做连接的感觉
December 10th, 2007 at 1:04 pm
恩,有这种感觉,不过我加这个只不过是为了串门方便而已~
December 10th, 2007 at 1:23 pm
我也是 当自己的收藏夹用的
December 10th, 2007 at 3:00 pm
呵呵,看了一下后台发现现在google adsense的点击费超级低,基本上都是0.02,0.03程度的~要想从google那里弄点钱出来还真是难啊
December 10th, 2007 at 3:45 pm
今天11下 0.78 大概是0.07每次~~~什么时候能倒日进1美元
December 10th, 2007 at 3:50 pm
我基本上每天1,2个点击……呵呵,没指望可以拿到美元了
你的单价也比我高~
December 10th, 2007 at 3:51 pm
0.78,再加2,3个点击就到1美元了~
December 10th, 2007 at 5:31 pm
不过平时都只有2-3的
December 10th, 2007 at 6:32 pm
单价低,要凑到100美元还真是不容易,sponsoredreviews那里昨天选了10个居然一个反应都没有,不容易啊不容易啊
December 11th, 2007 at 2:08 pm
呵呵 我要1年才有可能到100美金 飞机票都不够
December 11th, 2007 at 2:22 pm
支付服务器的钱应该够了~
January 28th, 2008 at 4:02 pm
总觉得这个少了一些代码
January 28th, 2008 at 4:16 pm
不需要的我都去掉了~
当然自己想加上去也没什么关系
January 28th, 2008 at 4:30 pm
呵呵 今天也是心血来潮啊
January 28th, 2008 at 5:27 pm
有心情折腾也不错~
我这估计差不多就这样了
January 29th, 2008 at 5:18 am
我觉得现在的不错啊
January 29th, 2008 at 8:44 am
呵呵,CSS还有一些问题的,不过影响也不大,懒得改了
June 14th, 2008 at 4:09 pm
呵呵 按照你的方法修改好像对我的主题也不管用啊
June 18th, 2008 at 8:28 am
@狂舞网络
上面用的都是WordPress中的标准函数,和模板其实并没有多大的关系,应该没有问题的啊。