Onbeperkte $1.99 domeinnamen - wij gebruiken goDaddy
Aangedreven door MaxBlogPress

De zeer Gemakkelijke Houwer van het Thema Wordpress: Toon de Beelden van de Categorie | De Fouten Blogging van JTPRATT
De Fouten van Blogging van JTPratt


Huis De“ zeer Gemakkelijke Houwer van het Thema Wordpress: Toon de Beelden van de Categorie



Gepost in:

het beeld van de blog-opstellingscategorie het beeld van de blogging-foutencategorie wordpress categoriebeeld
4.756 meningen


Gelieve van nota te nemen: Deze pagina werd oorspronkelijk geschreven in het Engels.

De originele post kan worden bekeken 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.


Ik ga u tonen hoe te om n of andere eenvoudige PHP code toe te voegen aan uw malplaatje Wordpress en verbonden beelden te maken in plaats van tekst voor uw categorien in posten verschijnen. Allen u moeten weten eenvoudige PHP, wat basisHTML, en hoe te om uw eigen grafiek te maken is.

** UPDATE ** Mei 2008
Zoals de laatste commentaar aan het eind van deze pagina toont is er nu a De Pictogrammen Wordpress Plugin van de categorie u kunt downloaden installeren om uw categoriepictogrammen in uw dashboard net te leiden. Als u verkiest uw thema te binnendringen in een beveiligd computersysteem, zal de code hieronder enkel fijn werken! Het koele ding over plugin is dat zij u manieren geven om n of veelvoudige categoriepictogrammen te doen, maar ook methodes om pictogrammen met uw categorien in de zijstaaf eveneens te zetten! Ik ben altijd zeer dankbaar wanneer een goede plugin zich voordoet! Nu terug naar de originele post…

Hebt u ooit Wordpress enkel het doen maken willen en e binnendringen in een beveiligd computersysteem en iets u het altijd wilde doen? Ik denk van dingen ik het niet altijd de hele tijd wil doen maar de uren heb aan het vinden van het antwoord te wijden. Ik heb gezocht naar PHP codesnippets voor Wordpress en leerprogramma's en hoe-aan artikelen eveneens en veel niet gezien die me werkelijk hielp. Tot vandaag - toen ik las de pagina van een priv-leraar in WPDesigner vandaag. Ik werd precies niet de code die ik, maar vrij heb gewenst gesloten. Ik moest enkel het binnendringen in een beveiligd computersysteem een beetje om het ertoe te brengen om te doen wat ik wilde.

Eerst, veronderstelt deze houwer Wordpress van een priv-leraar een paar dingen.

  1. U hebt uw Wordpress malplaatjecode voordien gewijzigd
  2. U kunt eenvoudige PHP wijzigen
  3. U kunt eenvoudig HTML schrijven
  4. U kunt uw eigen grafiek maken

Eerste dingen eerst - is hier de code:

<h3>< B> Gepost in: </b>< /h3>
<? php foreach ((get_the_category ()) als $cat)
	{
	$catname =$cat-> category_nicename;
	weergalm een „<href \ „/category/“;
	echo $catname;
	echo „/\“> „;
	echo „<img src \ „/wp-content/cat-pictogrammen“;
	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 =( =;; =)] =;;;