這里是我使用的WP插件,下面是我的安裝方法。
網站地圖插件Dagon Design Sitemap Generator
復制page.php文件并重命名為 sitemap.php,將如下代碼:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="entry"> <?php the_content('<p class="serif">閱讀全文 »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>頁面: </strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> </div> <?php endwhile; endif; ?> <?php edit_post_link('編輯', '<p>', '</p>'); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> |
改為如下代碼:
1 2 3 4 5 6 7 8 9 10 11 | <?php /* Template Name: SiteMap */ ?> <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php echo ddsg_create_sitemap(); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> |
即時存檔插件Extended Live Archives
復制page.php文件并重命名為 archives.php,將如下代碼:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="entry"> <?php the_content('<p class="serif">閱讀全文 »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>頁面: </strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> </div> <?php endwhile; endif; ?> <?php edit_post_link('編輯', '<p>', '</p>'); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> |
改為如下代碼:
1 2 3 4 5 6 7 8 9 10 11 | <?php /* Template Name: Extended Live Archives */ ?> <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php if (function_exists('af_ela_super_archive')) {af_ela_super_archive();} ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> |
防止ADSENSE被GOOGLE封的插件DupPrevent和防止垃圾留言的插件Spam Karma 2
這兩個插件啟用后,我直接就用了沒有設置。
代碼高亮插件CoolCode
我基本只用<coolcode></coolcode>插入代碼。
TAG插件Ultimate Tag Warrior
在你要顯示TAG的地方添加如下代碼:
1 2 3 | <?php /* Tags */ if (function_exists('UTW_ShowTagsForCurrentPost')) { ?> <?php UTW_ShowTagsForCurrentPost("commalist") ?> <?php } ?> |
分頁插件wp-pager2
找到所有如下代碼:
1 2 3 4 | <div class="navigation"> <div class="alignleft"><?php next_posts_link('« 上一頁') ?></div> <div class="alignright"><?php previous_posts_link('下一頁 »') ?></div> </div> |
1 2 3 4 | <p>改為如下代碼:</p> <div class="navigation"> <?php wp_pager(); ?> </div> |
日志查看數插件WP-PostViews
在你要顯示日志查看數的地方添加如下代碼:
1 | <?php if(function_exists('the_views')) { ?><?php the_views(); ?><?php } ?> |
中文 WordPress 工具箱
最新發表,最新留言,隨機日志等調用的插件,一般放在側欄,在<ul></ul>之間添加如下代碼
1 2 3 4 5 6 7 8 9 | <li><h2>隨機文章</h2> <ul><?php random_posts ($limit = 10, $length = 400, $before = '<li>', $after = '</li>', $show_pass_post = false, $show_excerpt_in_title = true); ?></ul> </li> <li><h2>最新文章</h2> <ul><?php get_recent_posts($no_posts = 10, $before = '<li>', $after = '</li>', $show_pass_post = false, $skip_posts = 0); ?></ul> </li> <li><h2>最新評論</h2> <ul><?php get_recent_comments($no_comments = 10, $before = '<li>', $after = '</li>', $show_pass_post = false); ?></ul> </li> |
站點統計插件WP Statistics
在你要顯示站點統計的地方添加如下代碼:
1 2 3 | <?php if ( (function_exists('ShowStatistics'))) { ?> <?php ShowStatistics(); ?> <?php } ?> |