Ελεύθερος έλεγχος για Bloggers - σημάδι επάνω σε 5 λεπτά!
Τροφοδοτημένος από MaxBlogPress

Πολύ εύκολη αμυχή θέματος Wordpress: Παρουσιάστε εικόνες κατηγορίας | Λάθη Blogging JTPRATT
Λάθη Blogging JTPratt


Σπίτι » Πολύ εύκολη αμυχή θέματος Wordpress: Παρουσιάστε εικόνες κατηγορίας



Ταχυδρομημένος σε:

εικόνα κατηγορίας blog-οργάνωσης εικόνα κατηγορίας blogging-λαθών wordpress εικόνα κατηγορίας
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 υποθέτει μερικά πράγματα.

  1. Έχετε τροποποιήσει τον κώδικα προτύπων Wordpress σας πριν
  2. Μπορείτε να τροποποιήσετε τα απλά πέσος Φιλιππίνων
  3. Μπορείτε να γράψετε το απλό HTML
  4. Μπορείτε να κάνετε τη γραφική παράστασή σας

Πρώτα πράγματα πρώτα - εδώ είναι ο κώδικας:

<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!


17 Responses to “Very Easy Wordpress Theme Hack: Show Category Images”

  1. The Smorgasbord Has the following to say...

    This was very easy to do - thanks for the code and the tip!

    The Smorgasbord’s last blog post..Convert Vinyl Records to MP3

  2. 50 tips y trucos para optimizar Blogger y WP | Blog en Serio Has the following to say...

    [...] Imágenes para las categorías [...]

  3. Blogbuster: блоги, blogs, blogging, RSS, Wordpress, социальное Has the following to say...

    25 неотстойных хаков для WordPress

    Динамическое слайдшоу в шапке — позволяет крутить картинки в шапке вашего блока, придает динамику; демоверсия.
    Пузырь комментариев — гр…

  4. 25 hacks para dinamizar seu Wordpress! — Bytes a Go-go! Has the following to say...

    [...] Imagens para categorias. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. [...]

  5. Blog Verde » 25 Hacks pra dinamizar o Wordpress Has the following to say...

    [...] Imagens para categorias. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. [...]

  6. 63 Essential Wordpress Hacks, Tutorials, Help Files and Cheats | Speckyboy - Wordpress and Design Has the following to say...

    [...] Show Category Images (Source: [...]

  7. 63 essenziali Wordpress Hacks, Tutorials, Help Files e Cheats : technorati.it Has the following to say...

    [...] Show Category Images (Source: [...]

  8. Wordpress Tutorials/Hacks « The house of software freeware Has the following to say...

    [...] Show Category Images (Source: [...]

  9. Mastering Your WordPress Theme Hacks and Techniques Has the following to say...

    [...] 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. [...]

  10. letrodectus Has the following to say...

    Great hack! thanks =

  11. 63 Essential Wordpress Hacks, Tutorials, Help Files and Cheats | Speckyboy - Wordpress and Design » 쟈스민(JASMIN) Has the following to say...

    [...] Show Category Images (Source: [...]

  12. paidnetpedia.com Has the following to say...

    [...] 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 [...]

  13. Submarine Has the following to say...

    Hi

    here is a plugin that do the job :

    Category Icons Plugin.

  14. Remkus Has the following to say...

    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!

  15. What is Category Icons ? « Category Icons Has the following to say...

    [...] : JTPRATT’s Blogging Mistakes ( here & here ), Performancing Helping Bloggers [...]

  16. 155 Wordpress Resources, Tutorials, Plugins, Themes, AJAX, Podcasting…WP Monster List | Speckyboy - Wordpress and Design Has the following to say...

    [...] 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 [...]

  17. 155个 WordPress 资源、指导、插件、主题、AJAX、播客…… —— WP 详细清单(译) | æ™´å¤©é‡Œçš„ä¸€é“å… Has the following to say...

    [...] 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 [...]

Question or Comment?? Spill it Now...

Jumping for Joy over comments!

We Reward Comments!


We dofollow links, and get your latest blog post as a byline under every new comment from the "CommentLuv" plugin! Top commenters for every month are listed on every page of this site in a sidebar widget linked back to your URL! We would like to reward you for becoming part of our community! Your comment is valuable not only to us, but also all the other readers of this blog!

 


Click to add smilies to your post! = =[] ^=( =(( =(| =)r =|8 =0 =)~ =00 =( =;; =)] =;;;