Subscribe to RSS feed訂閱RSS提要 or或 follow me跟我來 on Twitter? Twitter的?
Duplicate content is a serious issue for all WordPress blogs, and most bloggers now employ different methods to show partial content.重複的內容是一個嚴重的問題,所有WordPress博客,大多數博客現在採用不同的方法來顯示部分內容。 The only blogs with good search rankings which employ full posts, are usually authority blogs, which are labelled as safe and authoritative by Google's algorithm.唯一的博客搜索排名良好的聘請全職的職位,通常是權威的blog,被指為安全和權威性谷歌的算法。
Plugins are a popular method to reduce duplicate content.插件是一種常用的方法,以減少重複的內容。 However, plugins are not然而,沒有插件 fully optimized全面優化 , and consumes more server resources than the simple <?php the_excerpt() ?> tag. ,並消耗更多的服務器資源比簡單的<?php the_excerpt() ?>標記。 Moreover, excerpt tag can use the customized post summary that you may have written.此外,摘錄標籤可以使用簡易的自定義後,你可能會寫。
In this short tutorial, you should have all the template files in one place.在這個簡短的教程,你應該擁有所有的模板文件在一個地方。 Once you have those files(probably downloaded from your server, or a local copy that you keep), follow these easy steps:一旦你擁有這些文件(可能是您的服務器下載,或者本地副本您保留),按照以下簡單的步驟:
- Open up
index.php,archive.phpandsearch.php打開index.php archive.php和search.php - In each of these files, search and find the code bit that contains
<php the_content在每個這樣的文件,搜索並找到一些源代碼,其中包含<php the_content - Replace the entire tag – usually <?php the_content(__('Read the rest of this entry'));?> (may change depending on theme, but will be similar), with this tag:替換整個標記-通常是“?PHP的the_content (__('讀其餘這個詞條'));?>(可根據主題的變化,但類似),與這個標籤:
<?php the_excerpt();?> “?PHP的the_excerpt ();?>
Save the files.保存該文件。 - Open up
index.phpagain, and save it ascategory.php(do not discardindex.php).打開index.php再次,並將其保存為category.php不丟棄index.php)。
In the above steps, we have replaced the content tag with the excerpt tag so that only a short paragraph of the post is shown on pages other than the post page.在上述步驟,我們已經取代了內容標記與摘錄標記,以便只有很短段後顯示在頁面以外的帖子頁。 Most themes lack a category.php , and its absence can allow full posts on category pages.大多數的主題缺乏category.php而缺乏可以讓全員額的類別頁。 By duplicating the index.php file(which has excerpt tag), that problem is also solved.通過重複index.php文件(已摘錄標籤),這個問題也得到解決。
Open Mic開放式麥克風
How do you prevent duplicate content?如何防止重複的內容? Do you use this method, or any plugins?您是否使用此方法,或任何插件? If so, why do you prefer it over the excerpt tag?(I'd like to hear, as I am myself confused at which method to choose).如果是這樣,你為什麼喜歡它在摘錄標籤?(我想聽聽,因為我我感到困惑的選擇哪種方法)。 Do tell me your views through comments.不要告訴我你的意見,通過意見。
Related reading相關閱讀
- Plugins to enhance WordPress tagging提高WordPress的插件標記
- Search and remove duplicate files with Duplicate File Searcher搜索並刪除重複的文件與重複的文件搜索器
- Check Places Firefox addon checks offline and duplicate bookmarks抵店火狐插件檢查和重複書籤離線
- Free GIMP plugins免費的GIMP插件
This is exactly what I have been doing.這正是我一直在做。 Use post excerpts.使用後的摘錄。
@Nirmal: Glad to hear your opinion. @尼爾默爾:很高興聽到你的意見。 Could you be more specific as to why you prefer it?你能更具體的,為什麼你喜歡它?
Funny to run into this, I'd just blogged about something similar yesterday!有趣的運行這個,我只希望博客上講述類似的昨天! And you did this 2 days earlier – guess it was a repeat for you to read my feed then!和你沒有這2天前-猜這是重複你看我的飼料了!
[Goes over to subscribe to your feed] [去了訂閱您的供稿]
But I'd just like to make one clarification though – you won't need category.php if you have archive.php or index.php (err, you'd certainly have this one!).但我還想作一個澄清,但-你並不需要category.php如果您有archive.php或編輯(犯錯,你當然也有這一個!)。 What I meant was – if you are going to show excerpts on index.php, you can avoid having archive.php and category.php altogether – don't ask me why not, saves you 4kb on your webspace我的意思是-如果你要顯示在摘錄編輯,您可以避免archive.php和category.php完全-不要問我為什麼不,你4KB的節省您的網絡空間
The order is:該命令是:
1. 1。 category-xx.php類別xx.php
2. 2。 category.php category.php
3. 3。 archive.php archive.php
4. 4。 index.php編輯
If you'd like to make one particular category look unique, you can create a file with the category-CATEGORYNUMBER.php and that particular category would follow this template.如果您想提出一個獨特的特定類別看,您可以創建一個文件與類別CATEGORYNUMBER.php和特定類別將按照此模板。 If it doesn't find this file, it will check if the next file in the hierarchy is there and so on.如果它沒有找到這個文件,它會檢查,如果下一個文件在層次結構是存在的,等等。
Sorry about the overly long comment, I had to make myself clear!遺憾的過度評論,但我不得不說清楚!
@Karthik: No problem whatsoever about long comments – I love 'em! @ Karthik:沒有任何問題都對長期以來的意見-我愛他們!
Well, that thing about category-xx.php was something new to me, thanks.嗯,這事有關類別xx.php了一些新的我,感謝。 And category no.和類別沒有。 means its ID, right?意味著它的ID,對不對?
As for 4kB webspace, lol至於具有4kB網絡空間,lol
Yup, sorry, I should have mentioned ID there!是啊,對不起,我應該提到的身份證有!
@Karthik: No problem, its understood. @ Karthik:沒問題,它的理解。 Now that you've clarified it, readers will also understand.現在你已經澄清了,讀者也會明白。
My recommendation would be to do this but also have unique content in the excerpt.我建議將這樣做,但也有獨特內容的摘錄。
I have actually switched categories off entirely and have opted for pages instead.其實我已經完全關閉開關類,並選擇了網頁,而不是。
(Note the blog above is not an example of this ;-D ) (注意:以上的博客不是一個例子是,- D型)