Very Easy Wordpress Theme Hack: Show Category Images Sehr einfach Wordpress Thema Hack: Schau Kategorie Bilder
4,852 views - 4.852 Ansichten -Posted in: Verfasst am:
4,852 views 4.852 Ansichten
Please note: This page was originally written in English. Bitte beachten Sie: Diese Seite wurde ursprünglich in englischer Sprache geschrieben.
The original post can be viewed Der ursprüngliche Post angezeigt werden können here hier .
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.
I’m going to show you how to add some simple PHP code to your Wordpress template and make linked images appear instead of text for your categories in posts. Ich werde Ihnen zeigen, wie Sie einige einfache PHP-Code auf Ihrer Wordpress-Template und verknüpft die Bilder erscheinen anstelle von Text für Ihre Kategorien in Planstellen. All you need to know is simple PHP, some basic HTML, and how to make your own graphics. Alles was Sie wissen müssen, ist einfach PHP, einige grundlegende HTML, und wie man seine eigene Grafiken.
**UPDATE** May 2008 ** UPDATE ** Mai 2008
As the last comment at the end of this page shows there is now a Da die letzte Bemerkung am Ende dieser Seite zeigt, gibt es jetzt eine Category Icons Wordpress Plugin Kategorie Symbole wordpress plugin you can download to install to manage your category icons right in your dashboard. Sie können die Installation zu verwalten Ihre Kategorie die Symbole direkt in das Dashboard. If you prefer to hack your theme, the code below will work just fine! Wenn Sie lieber Ihr Thema Hack, den Code unten funktioniert gut! The cool thing about the plugin is that they give you ways to do one or multiple category icons, but also a methods for putting icons with your categories in the side bar as well! Das kühle, was über das Plugin ist, dass sie Ihnen Wege, um eine oder mehrere Kategorie-Icons, sondern auch ein Verfahren für das Inverkehrbringen die Symbole mit Ihren Klassen in der Side-Bar, wie gut! I’m always very grateful when a good plugin come along! Ich bin immer sehr dankbar, wenn eine gute Plugin-Komm mit! Now back to the original post… Nun zurück zu den ursprünglichen Post…
Have you ever wanted to hack Wordpress and just make it do something you always wanted it to do? Haben Sie jemals wollte Hack Wordpress und nur sie tun etwas, das Sie immer wollten es zu tun? I think of things I want it to do all the time but don’t always have the hours to devote to finding the answer. Ich denke an Dinge, die ich wollen, dass er alles tun, die Zeit aber nicht immer über die Stunden zu widmen und finden Sie die Antwort. I’ve searched for PHP code snippets for Wordpress and tutorials and how-to articles as well and haven’t seen much that really helped me. Ich habe gesucht für PHP-Code-Schnipsel für Wordpress und Tutorials und How-to articles so gut und haben nicht viel gesehen, dass mir wirklich geholfen. Until today - when I read Bis heute - wenn ich lese the tutorial page at WPDesigner today das Tutorial Seite in WPDesigner heute . I didn’t get exactly the code I needed, but pretty close. Ich habe nicht genau den Code ich brauchte, aber ziemlich nahe. I just needed to hack it a bit to get it to do what I wanted. Ich brauchte nur zu hacken sie ein wenig, um es zu tun, was ich wollte.
First, this Wordpress tutorial hack assumes a few things. Erstens, dieser Hack Wordpress Tutorial wird davon ausgegangen, ein paar Dinge.
- You’ve modified your Wordpress template code before Sie haben Ihre veränderte Wordpress-Template-Code vor
- You can modify simple PHP Sie können einfache PHP
- You can write simple HTML Sie können schreiben, einfache HTML -
- You can make your own graphics Sie können Ihre eigenen Grafiken
First things first - here’s the code: First things first - hier ist der Code:
<h3><b>Posted in:</b></h3> <?php foreach((get_the_category()) as $cat) { $catname =$cat->category_nicename; echo "<a href\"/category/"; echo $catname; echo "/\">"; echo "<img src\"/wp-content/cat-icons/"; echo $catname; echo ".png\" alt=\"$catname category image\" border=\"0\" /></a>\n"; } ?><br /> <h3> <b> Verfasst am: </ b> </ h3> <? php foreach ((get_the_category ()) as $ cat) ($ catname = $ cat-> Category_nicename; echo "<a href \" / Kategorie / "; Echo $ catname; echo" / \ ">"; echo "<img src \" / wp-content/cat-icons / "; echo $ catname; echo". Png \ "alt = \" $ catname Kategorie Bild \ "border = \" 0 \ "/> </ a> \ n";)?> <br /> I hacked this code from this tutorial page on WPdesigner I hacked diesem Code aus diesem Tutorial-Seite auf WPdesigner . The code they had was only good to display one category per post. Der Code hatte, war sie nur gut, um eine Kategorie per Post. I hacked it because my blogs all have posts assigned to multiple categories. Ich gehackt, weil meine Blogs haben alle Planstellen zugewiesen zu mehreren Kategorien. Also, I wanted the images to all be linked so people can just click them and go right to that category page. Auch wollte ich die Bilder für alle verknüpft werden können, so dass die Leute klicken Sie einfach auf sie und gehen Sie nach rechts auf dieser Kategorie vorhanden. Let’s look at the pieces of this code you might need to modify. Werfen wir einen Blick auf die Teile dieses Codes müssen Sie womöglich ändern.
In line 1, you might want change “Posted in:” to alternate text like “Filed under:”, etc. In Zeile 1, möchten Sie vielleicht ändern "Beitrag in:" auf alternative Text wie "Gespeichert unter:" usw.
In line 5, if your permalink structure is different than the default, you may need to change /category/ to what you are using. In Zeile 5, wenn Ihr permalink Struktur ist anders als der Standardwert, müssen Sie unter Umständen ändern / Kategorie / zu dem, was Sie verwenden.
In line 8 change /wp-content/cat-icons/ to wherever you will be storing your category icons in your site. In Zeile 8 ändern / wp-content/cat-icons / bis wo werden Sie Speichern Ihrer Kategorie Symbole in Ihre Website.
In line 10, if you are using gif’s or jpg’s change .png to your graphic file format. In Zeile 10, wenn Sie mit gif-oder jpg's ändern. Png zu Ihrer Grafik-Datei-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. Jetzt alles, was Sie zu tun haben, ist schaffen ein Bild für jede Kategorie haben Sie eine legen Sie sie in dem Ordner, den Sie gerade erstellt haben auf dem 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. Stellen Sie sicher, dass die Grafik ist bei Nennung genau so, wie Ihre Kategorien, und wenn Ihre Kategorien haben mehrere Worte fügen Sie einfach einen Bindestrich zwischen jedem Wort. That’s it! 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. Alles, was Sie zu entscheiden haben, ist jetzt, wo Sie wollen, dass diese Kategorie-Icons angezeigt werden, vor oder nach Ihrem Post - und fügen Sie sie in die entsprechende Stelle. 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. Ich habe mir nur nach dem Titel des Posts auf meinem einzigen Post-Seiten - wie Sie sehen können, an der Spitze der Post auf diese Seite verwiesen wurde. You can hack this category icon code a hundred other ways to do what you want. Sie können Hack dieser Kategorie Symbol-Code hundert andere Art und Weise zu tun was Sie wollen. I think in the future I’m going to use it to replace the text category links in my sidebar. Ich denke, in Zukunft werde ich sie ersetzen den Text Kategorie Links in meiner 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). Der einzige Vorbehalt, dass diese (und den Code Hack oben) wäre die Tatsache, dass, wenn Sie nicht über ein Bild einen Text-Link wird angezeigt (in FF, gebrochen oder Bild im IE). So - if you create new categories in the future, make sure you create a new image for each. Also - wenn Sie neue Kategorien in die Zukunft, stellen Sie sicher, dass Sie ein neues Bild für jeden.
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. Meine Blogging Fehle für diesen Post ist, dass ich nicht zu entscheiden, anpassen und hacken meine Wordpress Thema, bevor jetzt auf mein eigenes Layout. Do you have a question or a new way to hack up this wordpress category icon PHP code? Haben Sie eine Frage oder einen neuen Weg zu hacken diese Kategorie wordpress Symbol PHP-Code? Comments and post it now! Kommentare und schicken Sie es jetzt!




















January 8th, 2008 at 10:40 am 8. Januar 2008 um 10:40
This was very easy to do - thanks for the code and the tip! Dies war sehr leicht zu machen - Danke für den Code und die Spitze!
The Smorgasbord’s last blog post.. Die letzten Smorgasbord's Blog-Post .. Convert Vinyl Records to MP3 Wandeln Sie Vinyl-Schallplatten zu MP3
January 24th, 2008 at 9:47 pm 24. Januar 2008 um 9:47 pm
[...] Imágenes para las categorías [...] [...] Imágenes para las Kategorien [...]
January 25th, 2008 at 4:49 am 25. Januar 2008 in 4:49
25 неотстойных хаков для WordPress 25 неотстойных хаков для WordPress
Динамическое слайдшоу в шапке — позволяет крутить картинки в шапке вашего блока, придает динамику; демоверсия. Динамическое слайдшоу в шапке - позволяет крутить картинки в шапке вашего блока, придает динамику; демоверсия.
Пузырь комментариев — гр… Пузырь комментариев - гр…
January 25th, 2008 at 8:52 am 25. Januar 2008 um 8:52 Uhr
[...] Imagens para categorias. [...] Imagens para categorias. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. Adiciona Imagens para cada categoria do seu Blog e são mostradas keine Post Wenn Sie preferir. [...]
January 27th, 2008 at 2:48 pm 27. Januar 2008 auf 2.48 Uhr
[...] Imagens para categorias. [...] Imagens para categorias. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. Adiciona Imagens para cada categoria do seu Blog e são mostradas keine Post Wenn Sie preferir. [...]
March 9th, 2008 at 12:13 am 9. März 2008 in 12:13 Uhr
[...] Show Category Images (Source: [...] [...] Anzeigen Kategorie Bilder (Quelle: [...]
March 13th, 2008 at 12:40 am 13. März 2008 in 12:40 Uhr
[...] Show Category Images (Source: [...] [...] Anzeigen Kategorie Bilder (Quelle: [...]
March 13th, 2008 at 1:51 am 13. März 2008 in 1:51
[...] Show Category Images (Source: [...] [...] Anzeigen Kategorie Bilder (Quelle: [...]
March 16th, 2008 at 6:43 pm 16. März 2008 auf 6.43 Uhr
[...] 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) Karte Kategorie Bilder-Wie fügt man ein paar einfache PHP-Code auf Ihrer WordPress-Template und verknüpft die Bilder erscheinen anstelle von Text für Ihre Kategorien in Planstellen. [...]
March 17th, 2008 at 9:40 am 17. März 2008 in 9:40
Great hack! Great Hack! thanks Danke
March 23rd, 2008 at 7:40 am 23. März 2008 in 7:40
[...] Show Category Images (Source: [...] [...] Anzeigen Kategorie Bilder (Quelle: [...]
April 12th, 2008 at 12:18 pm 12. April 2008 um 12:18 Uhr
[...] sticky”- When we need to have certain articles ’stay at the top’ longer than others. [...] Klebrig "- Wann brauchen wir bestimmte Artikel" Aufenthalt an der Spitze "mehr als andere. 10)Show Category Images- How to add some simple PHP code to your WordPress template and make linked images appear instead [...] 10) Karte Kategorie Bilder-Wie fügt man ein paar einfache PHP-Code auf Ihrer WordPress-Template und verknüpft die Bilder erscheinen statt [...]
April 15th, 2008 at 2:02 am 15. April 2008 um 2:02
Hi
here is a plugin that do the job : hier ist ein Plugin, dass Sie den Job:
Category Icons Plugin Kategorie Symbole Plugin .
April 19th, 2008 at 10:47 am 19. April 2008 um 10.47 Uhr
That is a very nice Hack! Das ist ein sehr netter Hack! I realize there is a plugin now, but I think I am going to just edit this in one of my projects. Ich weiss, dass es ein Plugin ist jetzt, aber ich denke, ich werde einfach ändern dies in einem meiner Projekte. Thanks for writing it down! Vielen Dank für das Schreiben it down!
April 21st, 2008 at 9:02 am 21. April 2008 um 9:02
[...] : JTPRATT’s Blogging Mistakes ( here & here ), Performancing Helping Bloggers [...] [...]: JTPRATT's Blogging Fehler (hier und hier), Performancing Helping Bloggers [...]
April 27th, 2008 at 9:50 am 27. April 2008 in 9:50
[...] 84. [...] 84. No More CSS Hacks. No more CSS-Hacks. 85. Create a Dynamic Sticky. Schaffung eines dynamischen klebrig. 86. Styling Individual Posts Using the_ID. Styling einzelne Posts Mit the_ID. 87. Show Category Images. Kategorie Bilder anzeigen. 88. Separate WordPress Comments and Trackbacks. Separate WordPress Kommentare und Trackbacks. 89. Customize your WordPress Login. Passen Sie Ihre Login WordPress. 90. Date Image [...] Datum Bild [...]
May 16th, 2008 at 2:26 am 16. Mai 2008 um 2:26
[...] 84. [...] 84. No More CSS Hacks 85. No More 85 CSS-Hacks. Create a Dynamic Sticky 86. Schaffung eines dynamischen Sticky 86. Styling Individual Posts Using the_ID 87. Styling einzelne Posts Mit the_ID 87. Show Category Images 88. Kategorie anzeigen 88 Bilder. Separate WordPress Comments and Trackbacks 89. Separate WordPress Kommentare und Trackbacks 89. Customize your WordPress Login 90. Passen Sie Ihre Login WordPress 90. Date Image [...] Datum Bild [...]