• Plugin名稱:Where did they go from here?
  • 改良版:Where did they go from here 插件修改版

    我把這個插件修改了下,讓它只記錄瀏覽過的日誌。並且把其中的自動把這個列表功能取消。現在你調用這個插件需要手動在 single.php 模板中加入 show_where_they_go() 這個函數。

  • 功能:在頁面上紀錄並列出看這篇文章的人也看哪些文章
  • 語系:English
  • 適用wordpress版本:2.0~2.5以上

安裝

  • 下載Where did they go from here?,解壓縮後放置到 /wordpress/wp-content/plugins/ 資料夾下,並到後台啟用即可(假如你使用修改版的需放置程式碼)。

自訂位置

預設啟用後,會將文章列表顯示在留言表單下方
2008-06-11_184044 (by vsy)

假如你想要搬移列表出現的位置,請照以下步驟:

  • 開啟wheredidtheygov1.php,找到倒數第三行,刪掉它
    add_action('comment_form','show_where_they_go');
  • 開啟使用中的佈景主題的single.php,加入這段程式碼
    <?php if (function_exists('show_where_they_go')) show_where_they_go(); ?>

    範例:讓列表出現在文章內文後

    <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
    <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
    <?php if (function_exists('show_where_they_go')) show_where_they_go(); ?>
    

    2008-06-11_185529 (by vsy)

更改顯示樣式、中文化

假如你想更改顯示樣式,請開啟wheredidtheygov1.php,在最後小心地更改HTML部份,以下是去除大標題、使用粗體字、並中文化的範例:

	echo "<strong>看這篇文章的人,他們也看:</strong><ul>";
	if ($lpids) {
		foreach ($lpids as $lpid) {
			echo '<li><a href="'.get_permalink($lpid).'">'.get_the_title($lpid).'</a></li>';
		}
	}
	else
		echo '<li>(還沒有資料)</li>';
	echo "</ul>";

2008-06-11_190708 (by vsy)

注意!
若你將外掛內容更改為中文,必須在存檔文件時另存為「UTF8不含BOM」才不會造成亂碼或程式錯誤
Popularity: 6% [?]