Wordpress如何建立标签页

二月 26th, 2009

不懂PHP
却喜欢捣鼓Wordpress
曾经想装个Simple tags插件,后来越弄越不称心,加之不满主题,不了了之
今突发奇想,打算给个页面做tags,于是,网上四处取经
不知是主题不合,还是因为我就是不装插件,一直没弄出来
冲动之下,仔细研究了别人的代码
竟让我删删改改出来
借用wordpress自带的tags,新建一PHP文件,复制以下代码(将每行开头的”>”替换成”<”):

>?php
/*
Template Name: Tags
*/
?>
>?php get_header(); ?>
>?php get_sidebar(); ?>
>div id=”main”>
>div id=”archive” class=”box”>
>?php wp_tag_cloud(); ?>
>/div>
>/div>
>?php get_footer(); ?>

命名为tags.php,上传至所用主题文件夹下,然后新建一页面,标题为Tags,缩略名亦为tags,选择使用tags模板,发布,OK。

6 Comments Add your own

  • 1. iluha88  |  十二月 26th, 2009 at 2:17 上午

    I want to quote your post in my blog. It can?
    And you et an account on Twitter?

  • 2. admin  |  十二月 26th, 2009 at 2:05 下午

    @iluha88: No problem, but please quote annotated source.

  • 3. cyclone77  |  一月 5th, 2010 at 5:26 下午

    你好!你的链接是如何自定义的,我也自定义怎么不行,显示的是404页面,为什么,请指教.xiexie

  • 4. admin  |  一月 5th, 2010 at 7:03 下午

    @cyclone77: 后台-设置-固定链接-月份和文章名-保存更改,对于每篇文章我都有自定义文章名,你应该在更改固定链接方式后查看和修正以前文章的链接。不客气

  • 5. cyclone77  |  一月 5th, 2010 at 9:03 下午

    你的qq说一下,我的是1906151xx

  • 6. admin  |  一月 5th, 2010 at 9:11 下午

    OK

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Posts by Month

Tags

Links

Feeds