Subscribe to RSS feed Prenumerera på RSS-flöde or eller follow me Följ mig on Twitter? på Twitter?
Duplicate content is a serious issue for all WordPress blogs, and most bloggers now employ different methods to show partial content. Duplicera innehåll är en viktig fråga för alla WordPress bloggar, och de flesta bloggare nu använder olika metoder för att visa delar av innehållet. 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. De enda bloggar med god sökning ranking som sysselsätter full tjänster, vanligen myndigheten bloggar, som är märkta som säker och auktoritativ av Googles algoritm.
Plugins are a popular method to reduce duplicate content. Plugins är en populär metod för att minska dubbletter. However, plugins are not Men plugins inte fully optimized helt optimerade , and consumes more server resources than the simple <?php the_excerpt() ?> tag. Och förbrukar mer serverresurser än enkel <?php the_excerpt() ?> Tagg. Moreover, excerpt tag can use the customized post summary that you may have written. Dessutom utdrag tagg kan använda anpassade efter sammanfattning som du kan ha skrivit.
In this short tutorial, you should have all the template files in one place. I denna korta handledningen ska du ha alla mallfiler på ett ställe. Once you have those files(probably downloaded from your server, or a local copy that you keep), follow these easy steps: När du har dessa filer (förmodligen hämtat från din server, eller en lokal kopia som du hålla), följ dessa enkla steg:
- Open up
index.php,archive.phpandsearch.phpÖppnaindex.php archive.phpochsearch.php - In each of these files, search and find the code bit that contains
<php the_contentI vart och ett av dessa filer, sök och hitta koden bit som innehåller<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: Ersätt allt taggen - vanligtvis <? Php the_content (__(' Läs resten av posten'));?> (kan ändras beroende på temat, men kommer att vara liknande), med denna tagg:
<?php the_excerpt();?> <? php the_excerpt ();?>
Save the files. Rädda filer. - Open up
index.phpagain, and save it ascategory.php(do not discardindex.php). Öppnaindex.phpigen, och spara det somcategory.php(inte kastaindex.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. I ovanstående steg, vi har ersatt innehållet tag med utdrag tag så att endast ett kort stycke av tjänsten finns på sidorna än efter sida. Most themes lack a category.php , and its absence can allow full posts on category pages. De flesta teman saknar category.php och dess frånvaro kan tillåta full tjänster på kategori sidor. By duplicating the index.php file(which has excerpt tag), that problem is also solved. Genom att dubblera den index.php fil (som har utdrag tag), det problemet är löst.
Open Mic Open Mic
How do you prevent duplicate content? Hur hindrar ni innehållsdubbletter? Do you use this method, or any plugins? Använder du denna metod, eller 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). Om ja, varför föredrar du den över utdrag tag? (Jag skulle vilja höra, som jag själv är förvirrad på vilken metod att välja). Do tell me your views through comments. Vill berätta era åsikter genom kommentarer.
This is exactly what I have been doing. Detta är precis vad jag har gjort. Use post excerpts. Använd post inslag.
@Nirmal: Glad to hear your opinion. @ Nirmal: Kul att höra er åsikt. Could you be more specific as to why you prefer it? Kan du vara mer specifik om varför ni föredrar det?
Funny to run into this, I'd just blogged about something similar yesterday! Kul att stöta på här, jag skulle bara blogged om något liknande i går! And you did this 2 days earlier – guess it was a repeat for you to read my feed then! Och du gjorde det 2 dagar tidigare - gissa att det var en gång för dig att läsa min foder då!
[Goes over to subscribe to your feed] [Goes över att prenumerera på ditt foder]
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!). Men jag skulle bara vilja göra ett förtydligande dock - du inte behöver category.php om du har archive.php eller index.php (err, skulle du säkert ha detta en!). 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 Vad jag menade var - om du ska visa utdrag på index.php kan du slippa archive.php och category.php helt - fråga mig inte varför inte, sparar du 4kb på din Webspace
The order is: Ordern är:
1. 1. category-xx.php kategori-xx.php
2. 2. category.php category.php
3. 3. archive.php archive.php
4. 4. index.php 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. Om du vill göra en särskild kategori ser unik, kan du skapa en fil med kategori-CATEGORYNUMBER.php och att viss kategori skulle följa den här mallen. If it doesn't find this file, it will check if the next file in the hierarchy is there and so on. Om den inte hittar filen, kommer det att kontrollera om nästa fil i hierarkin är det och så vidare.
Sorry about the overly long comment, I had to make myself clear! Ledsen för den alltför långa kommentar, jag var tvungen att göra mig klar!
@Karthik: No problem whatsoever about long comments – I love 'em! @ Karthik: Inga som helst problem om långa kommentarer - Jag älskar dem!
Well, that thing about category-xx.php was something new to me, thanks. Tja, det där om kategori-xx.php var något nytt för mig, tack. And category no. Och kategori nej. means its ID, right? betyder dess ID, eller hur?
As for 4kB webspace, lol När det gäller 4kB Webspace, lol
Yup, sorry, I should have mentioned ID there! Ja, förlåt, jag borde ha sagt ID där!
@Karthik: No problem, its understood. @ Karthik: Inga problem, det förstås. Now that you've clarified it, readers will also understand. Nu när du har klargjort det, läsarna kommer också att förstå.
My recommendation would be to do this but also have unique content in the excerpt. Min rekommendation är att göra detta, men också unikt innehåll i utdrag.
I have actually switched categories off entirely and have opted for pages instead. Jag har faktiskt bytt kategorier bort helt och har valt sidor istället.
(Note the blog above is not an example of this ;-D ) (Not bloggen ovan är inte ett exempel på detta,-D)