Αμυχή Wordpress #15: Χαράσσοντας ετικέττες Wordpress
288 απόψεις -Ταχυδρομημένος σε:
288 απόψεις
Παρακαλώ σημειώστε: Αυτή η σελίδα γράφτηκε αρχικά στα αγγλικά.
Η αρχική θέση μπορεί να αντιμετωπισθεί εδώ.
Please note: This page was originally written in English.
The text has been translated using an online service such as Google or Babelfish.
The original post can be viewed here.
Σήμερα θα μάθουμε πώς να προσθέσουμε την υποστήριξη ετικεττών με τη χάραξη του θέματος Wordpress σας!
Αυτό είναι ημέρα #15 30 αμυχές Wordpress σε 30 ημέρες.
Εάν χρησιμοποιείτε Wordpress 2.3x ή 2.5 ή υψηλότερος εσείς έχουν τη δυνατότητα να χρησιμοποιήσουν «τις ετικέττες». Εάν χρησιμοποιείτε τα κοινωνικά μέσα καθόλου, πρέπει ήδη να ξέρετε τι μια ετικέττα είναι. Βασικά είναι ακριβώς ένα κομμάτι των μεταδεδομένων, ένας «περιγραφέας» κάποιου είδους. Όταν blog, αυτό είστε επίσης ένας άλλος τρόπος στη θυρίδα και αρχειοθετείτε το περιεχόμενό σας. Η εφαρμογή των ετικεττών σε Wordpress είναι πολύ σημαντική, επειδή κρατά τους ανθρώπους από «τη χρησιμοποίηση των κατηγοριών ως ετικέττες» δεδομένου ότι οι πολύτα από εμάς έχουν κάνει κατά τη διάρκεια των ετών. Υπεάρξαν δωδεκάδες των plugins διαθέσιμων για να προσθέσουν τις ετικέττες στο Wordpress σας blog, αλλά τώρα όλη αυτή η λειτουργία είναι διαθέσιμη χωρίς να χρησιμοποιήσει οποιαδήποτε plugins καθόλου.
Σκεφτείτε τις κατηγορίες ως υψηλού επιπέδου περιγραφές. Τι συμπαθείτε στο blog περίπου; Κινηματογράφοι, μουσική, πολιτική, και σχέδιο Ιστού. Εκείνες είναι κατηγορίες. Εντούτοις, όταν εσείς blog - οι ετικέττες θα ήταν Obama, John Candy, AC/DC, και HTML. Το πάρτε; Όλος που πρέπει να κάνετε είναι εισάγει τις ετικέττες περιγραφής όταν εσείς blog, μαζί με μια κατηγορία. Τώρα αναρωτιέστε πιθανώς, τι εγώ κάνετε με εκείνες τις πληροφορίες;
Ανάλογα με πόσο παλαιό το θέμα σας είναι μπορεί ή δεν να έχει τη «υποστήριξη ετικεττών», το οποίο σημαίνει ότι δύναμη όχι κωδικοποιείται για να κάνει τίποτα καθόλου με εκείνες τις ετικέττες που εισάγετε. Το πρώτο πράγμα μπορείτε να κάνετε είναι να προσθέσει ένα (τώρα διάσημο) «σύννεφο ετικεττών» στο δευτερεύοντα φραγμό σας όπως, με αυτόν τον κώδικα:
<; πέσος Φιλιππίνων εάν (function_exists («wp_tag_cloud»)): ;>
<λι>
<h2> δημοφιλείς ετικέττες< /h2>
<ul>
<; πέσος Φιλιππίνων wp_tag_cloud («smallest=8&largest=22») ;>
</ul>
</li>
<; πέσος Φιλιππίνων endif ;>
Εάν θέλετε να ξέρετε περισσότερων για το πώς εκείνοι οι κώδικες λειτουργούν και το πώς μπορείτε να το τροποποιήσετε, επισκεφτείτε Σελίδα σύννεφων ετικεττών κωδίκων Wordpress.
Another thing you can do is to add the tags you used beneath your post by adding some code to your single.php file (for single posts). You could do it on your index.php home page as well, but I don’t much see the point in that. All you have to do is add the following code near the end of the loop to display the tags used at the end of the post:
<?php the_tags('<p>Tags: ', ', ', '</p>'); ?>
So, now we’ve talked about how to modify your theme to add the tags used after a post, and how to place a tag cloud in your sidebar (without using a plugin). Click on one of the links in my post (to a tag) or my tag cloud and you’ll see (much like a category page) it goes to a “tag” page, or something like site.com/tag/wordpress-hack.
Be default Wordpress will look for the “tag.php” file (that most themes don’t have), and if there isn’t one your archive.php will be used by default. You could just leave this as-is, or create your own custom “tag.php” to make your tag pages unique. One way to do this would be to add a “tag cloud” to the top of each tag page. The Wordpress Codex Tag Page has more information on creating a custom tag.php file for your theme.
This post was all about “how to add tag support to your Wordpress theme”. In a future post, I’ll show you what you need to know about tagged pages and Wordpress SEO. As always, if you have something to add to make this post better, or a question - comment now!
Tags: codex, support, tag.php, tags, theme, wordpress-hack





















May 15th, 2008 at 3:44 pm
You have a really good tutorial there quick and easy to follow, you should amke it into an article and do some article submissions with it to attract more people to your site.
Really like that and keep up the good work :)
unique articless last blog post..The Art Of Online Writing
May 18th, 2008 at 1:31 pm
LOL I was just looking for this yesterday! Thanks for the little tidbit!
Erikas last blog post..1
June 2nd, 2008 at 1:43 pm
Categories are nice to start your site off. Use the descriptions of the categories to add keyword content like JT talks about and then the tags to get specific. I don’t add tags till I have some pages going. . . looks bad to have one post in ten places.
I haven’t found a problem with duplicate content using tags. I know it’s a big topic but google seems to be ok with tags. I’ve been adding tons on my wordpress.com blog and haven’t seen any problems. However, I do like to keep them to a smaller number on my main blogs but I’ve seen others that use them by the truck loads.
CJs last blog post..Sorbs