Ταχυδρομημένος σε:
4.759 απόψεις
Παρακαλώ σημειώστε: Αυτή η σελίδα γράφτηκε αρχικά στα αγγλικά.
Η αρχική θέση μπορεί να αντιμετωπισθεί εδώ.
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 σας και να κάνω τις συνδεμένες εικόνες να εμφανιστούν αντί του κειμένου για τις κατηγορίες σας στις θέσεις. Όλοι εσείς πρέπει να ξέρουν ότι είναι απλά πέσος Φιλιππίνων, κάποιο βασικό HTML, και πώς να κάνει τη γραφική παράστασή σας.
** ΑΝΑΠΡΟΣΑΡΜΟΓΗ ** Μαΐου 2008
Όπως το τελευταίο σχόλιο στο τέλος αυτής της σελίδας παρουσιάζει υπάρχει τώρα α Εικόνες Wordpress Plugin κατηγορίας μπορείτε να μεταφορτώσετε για να εγκαταστήσετε για να διαχειριστείτε τις εικόνες κατηγορίας σας δεξιά στο ταμπλό σας. Εάν προτιμήσετε να χαράξετε το θέμα σας, ο κώδικας κατωτέρω θα λειτουργήσει ακριβώς λεπτό! Το δροσερό πράγμα για το plugin είναι ότι σας δίνουν τους τρόπους να κάνουν το ένα ή τις πολλαπλάσιες εικόνες κατηγορίας, αλλά και μέθοδοι για τις εικόνες με τις κατηγορίες σας στο δευτερεύοντα φραγμό επίσης! Είμαι πάντα πολύ ευγνώμων όταν έρχεται εμπρός ένα καλό plugin! Τώρα πίσω στην αρχική θέση…
Έχετε θελήσει πάντα να χαράξετε Wordpress και να το κάνετε ακριβώς να κάνει κάτι που το θελήσατε πάντα για να κάνετε; Σκέφτομαι ότι των πραγμάτων το θέλω για να κάνω όλη την ώρα αλλά όχι πάντα έχω τις ώρες που αφιερώνουν στην εύρεση της απάντησης. Έχω ψάξει για τα αποκόματα κώδικα πέσος Φιλιππίνων για Wordpress και τα σεμινάρια και πώς-στα άρθρα επίσης και δεν έχω δει πολύ που με βοήθησε πραγματικά. Μέχρι σήμερα - όταν διάβασα η διδακτική σελίδα σε WPDesigner σήμερα. Δεν πήρα ακριβώς τον κώδικα που χρειάστηκα, αλλά αρκετά κλείνω. Έπρεπε ακριβώς να το χαράξω για να το πάρω λίγο για να κάνω τι θέλησα.
Κατ' αρχάς, αυτή η διδακτική αμυχή Wordpress υποθέτει μερικά πράγματα.
- Έχετε τροποποιήσει τον κώδικα προτύπων Wordpress σας πριν
- Μπορείτε να τροποποιήσετε τα απλά πέσος Φιλιππίνων
- Μπορείτε να γράψετε το απλό HTML
- Μπορείτε να κάνετε τη γραφική παράστασή σας
Πρώτα πράγματα πρώτα - εδώ είναι ο κώδικας:
<h3>< β> που ταχυδρομείται σε: </b>< /h3>
<; πέσος Φιλιππίνων foreach ((get_the_category ()) σαν $cat)
{
$catname =$cat-> category_nicename
αντηχήστε «<ένα href \ «/category/»
ηχώ $catname
«ηχούς/\»> «
IMG src< \ «/wp-content/cat-εικόνες» ηχούς «
echo $catname;
echo ".png\" alt=\"$catname category image\" border=\"0\" /></a>\n";
}
?><br />
I hacked this code from this tutorial page on WPdesigner. The code they had was only good to display one category per post. I hacked it because my blogs all have posts assigned to multiple categories. Also, I wanted the images to all be linked so people can just click them and go right to that category page. Let’s look at the pieces of this code you might need to modify.
In line 1, you might want change “Posted in:” to alternate text like “Filed under:”, etc.
In line 5, if your permalink structure is different than the default, you may need to change /category/ to what you are using.
In line 8 change /wp-content/cat-icons/ to wherever you will be storing your category icons in your site.
In line 10, if you are using gif’s or jpg’s change .png to your graphic file format.
Now all you have to do is create one image for every category you have an place them in the folder you just created on the server. Make sure that the graphics are named exactly as your categories, and if your categories have multiple words just add a hyphen in between each word. That’s it! All you have to decide now is where you want these category icons to appear, before or after your post - and add them into the appropriate place. I placed mine just after the title of the post on my single post pages - as you can see at the top of the post on this page. You can hack this category icon code a hundred other ways to do what you want. I think in the future I’m going to use it to replace the text category links in my sidebar. The only caveat to this (and the code hack above) would be the fact that if you don’t have an image a text link will display (in FF, or broken image in IE). So - if you create new categories in the future, make sure you create a new image for each.
My Blogging Mistake for this post is that I didn’t decide to customize and hack my Wordpress Theme before now to create my own layout. Do you have a question or a new way to hack up this wordpress category icon PHP code? Comments and post it now!





















January 8th, 2008 at 10:40 am
This was very easy to do - thanks for the code and the tip!
The Smorgasbord’s last blog post..Convert Vinyl Records to MP3
January 24th, 2008 at 9:47 pm
[...] Imágenes para las categorÃas [...]
January 25th, 2008 at 4:49 am
25 неоÑÑÑойнÑÑ Ñ Ð°ÐºÐ¾Ð² Ð´Ð»Ñ WordPress
ÐинамиÑеÑкое ÑлайдÑÐ¾Ñ Ð² Ñапке â позволÑÐµÑ ÐºÑÑÑиÑÑ ÐºÐ°ÑÑинки в Ñапке ваÑего блока, пÑÐ¸Ð´Ð°ÐµÑ Ð´Ð¸Ð½Ð°Ð¼Ð¸ÐºÑ; демовеÑÑиÑ.
ÐÑзÑÑÑ ÐºÐ¾Ð¼Ð¼ÐµÐ½ÑаÑиев â гх
January 25th, 2008 at 8:52 am
[...] Imagens para categorias. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. [...]
January 27th, 2008 at 2:48 pm
[...] Imagens para categorias. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. [...]
March 9th, 2008 at 12:13 am
[...] Show Category Images (Source: [...]
March 13th, 2008 at 12:40 am
[...] Show Category Images (Source: [...]
March 13th, 2008 at 1:51 am
[...] Show Category Images (Source: [...]
March 16th, 2008 at 6:43 pm
[...] 10)Show Category Images- How to add some simple PHP code to your WordPress template and make linked images appear instead of text for your categories in posts. [...]
March 17th, 2008 at 9:40 am
Great hack! thanks
March 23rd, 2008 at 7:40 am
[...] Show Category Images (Source: [...]
April 12th, 2008 at 12:18 pm
[...] stickyâ- When we need to have certain articles âstay at the topâ longer than others. 10)Show Category Images- How to add some simple PHP code to your WordPress template and make linked images appear instead [...]
April 15th, 2008 at 2:02 am
Hi
here is a plugin that do the job :
Category Icons Plugin.
April 19th, 2008 at 10:47 am
That is a very nice Hack! I realize there is a plugin now, but I think I am going to just edit this in one of my projects. Thanks for writing it down!
April 21st, 2008 at 9:02 am
[...] : JTPRATT’s Blogging Mistakes ( here & here ), Performancing Helping Bloggers [...]
April 27th, 2008 at 9:50 am
[...] 84. No More CSS Hacks. 85. Create a Dynamic Sticky. 86. Styling Individual Posts Using the_ID. 87. Show Category Images. 88. Separate WordPress Comments and Trackbacks. 89. Customize your WordPress Login. 90. Date Image [...]
May 16th, 2008 at 2:26 am
[...] 84. No More CSS Hacks 85. Create a Dynamic Sticky 86. Styling Individual Posts Using the_ID 87. Show Category Images 88. Separate WordPress Comments and Trackbacks 89. Customize your WordPress Login 90. Date Image [...]