Very Easy Wordpress Theme Hack: Show Category Images 매우 쉽습 wordpress 테마 마차 : 범주 이미지를 표시
4,858 views - 4858 조회 -Posted in: 게시 :
4,858 views 4858 조회
Please note: This page was originally written in English. 참고 사항 :이 페이지는 원래 영어로 작성된합니다.
The original post can be viewed 게시물의 원래으로 볼 수있습니다 here 여기에 . 합니다.
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. 나는 간다를 추가하는 방법을 보여 드리고 wordpress 간단한 코드를 템플릿과 연결된 이미지를 만들어 귀하의 범주를 게시물에 대한 텍스트 대신에 나타납니다. All you need to know is simple PHP, some basic HTML, and how to make your own graphics. 당신들이 알아야 할 모든는 간단하다 php, 일부 기본, 그리고 자신의 그래픽을 만드는 방법.
**UPDATE** May 2008 ** 업데이 트를 ** 2008년 5월
As the last comment at the end of this page shows there is now a 마지막으로이 페이지의 끝에 코멘트를 보여줍니다가 이제는 Category Icons Wordpress Plugin 범주 아이콘 플러그 접속식 you can download to install to manage your category icons right in your dashboard. 다운로드하실 수있습니다 범주 아이콘을 관리하는 권리를 설치하는 대시보드에있습니다. If you prefer to hack your theme, the code below will work just fine! 해킹하고자 할 경우 귀하의 테마를 아래의 코드가 잘 작동! 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! 차가운 생각이 플러그인은이 방법을 그들이 너에게 다음 중 하나 또는 여러 개의 범주 아이콘지만 퍼팅 방법을 또한 귀하의 범주를 옆 표시줄에 아이콘을 좋아! I’m always very grateful when a good plugin come along! 나는 항상 좋은 때 매우 감사 플러그 접속 시작합시다! Now back to the original post… 현재 게시물을 다시 원래…
Have you ever wanted to hack Wordpress and just make it do something you always wanted it to do? 해킹 적이 있습니까? wordpress, 단지 그것을 항상 갖고 그것을 할 필요합니까? 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. 난 그것이 당신이 할 일들에 대한 내 생각이 모든 시간이 얼마 안에 항상 그 대답을 찾는 데 시간을 할애합니다. 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. 나는 wordpress 및 자습서를 검색한 코드 발췌 -이 기사를하는 방법도하고, 정말 도움 많이 보지 못했합니다. Until today - when I read 오늘까지 - 언제 읽었 the tutorial page at WPDesigner today 오늘이 튜토리얼 페이지를 방문 wpdesigner . 합니다. I didn’t get exactly the code I needed, but pretty close. 나는 필요로의 코드를 정확하게 파악하지 못했다,하지만 매우 닫습니다. I just needed to hack it a bit to get it to do what I wanted. 단지 약간를 해킹할 필요가 그것을 무슨 싶었합니다.
First, this Wordpress tutorial hack assumes a few things. 첫째로,이 wordpress 자습서 해킹라고 생각하는 몇 안되는 것들도있습니다.
- You’ve modified your Wordpress template code before 템플릿 코드를 업데이 트하기 전에 귀하의 wordpress
- You can modify simple PHP 을 수정할 수있습니다 간단한 php
- You can write simple HTML 작성할 수있습니다 간단한
- You can make your own graphics 자신의 그래픽 만들 수있습니다
First things first - here’s the 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>에 게시된 : </ b> </ 토론 내용보기> <함수 foreach ((get_the_category ())로 $ 고양이) ($ catname = $ 고양이 -> category_nicename; 에코 "<a href \"/ 분류 / "; 에코 $ catname; 에코"/ \ ">"; 에코 "<공간 src \"/ wp-content/cat-icons / "; 에코 $ catname; 에코"합니다. png \ "높음 = \"$ catname 분류 이미지를 \ "국경 = \"0 \ "/> </> \ n";)?> </> I hacked this code from this tutorial page on WPdesigner 나는이 튜토리얼 페이지를 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. 서열 1,셔야 변경 "에 게시된 :"로 대체 텍스트를 같이 "밑에 :", 등등
In line 5, if your permalink structure is different than the default, you may need to change /category/ to what you are using. 서열 5 일 영구 링크 구조가 다를 경우 기본값을 변경해야 할 수도있습니다 / 범주 / 어떤을 사용합니다.
In line 8 change /wp-content/cat-icons/ to wherever you will be storing your category icons in your site. 8 호선을 변경 / wp-content/cat-icons / 당신의 범주를 어디에서 아이콘이 귀하의 사이트에 보관합니다.
In line 10, if you are using gif’s or jpg’s change .png to your graphic file format. 서열 10, gif를 사용하는 경우 또는 jpg의 변경합니다. png의 그래픽 파일 형식을합니다.
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). 유일하게 경고를 (그리고 코드를 해킹 위)는 사실을이 이미지를하지 않은 경우에 텍스트 링크가 표시됩니다 (ff, 또는 깨진 이미지를 예 :). 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. 이 게시물에 대한 실수를 내 블로그가 안 내 wordpress 테마하기로 결정하기 전에 사용자 정의 및 해킹을하려면 지금 나의 자신의 레이아웃을 작성합니다. Do you have a question or a new way to hack up this wordpress category icon PHP code? 당신도 해킹을하는 새로운 방법을 질문 또는 카테고리 아이콘이 wordpress 코드? Comments and post it now! 코멘트와 포스트 지금 당장!




















January 8th, 2008 at 10:40 am 2008년 1월 8일에서 오전 10시 40분
This was very easy to do - thanks for the code and the tip! 이것은 매우 쉬운 일은 아닙니다 - 주셔서 감사합니다 코드와 팁!
The Smorgasbord’s last blog post.. the 뷔페의 마지막 블로그 게시물 .. Convert Vinyl Records to MP3 비닐 레코드를 mp3로 변환
January 24th, 2008 at 9:47 pm 2008년 1월 24일에서 오후 9시 47분
[...] Imágenes para las categorías [...] [...] 이미지 파라 라스 종류 [...]
January 25th, 2008 at 4:49 am 2008년 1월 25일에서 오전 4시 49분
25 неотстойных хаков для WordPress 25 неотстойных хаков для wordpress
Динамическое слайдшоу в шапке — позволяет крутить картинки в шапке вашего блока, придает динамику; демоверсия. динамическое слайдшоу в шапке - позволяет крутить картинки в шапке вашего блока, придает динамику; демоверсия합니다.
Пузырь комментариев — гр… пузырь комментариев - гр…
January 25th, 2008 at 8:52 am 2008년 1월 25일에서 오전 8시 52분
[...] Imagens para categorias. [...] 이미지 카테고리 이동합니다. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. 각각의 범주 adiciona 이미지 이메일 서울시 종로구 mostradas하지 서으 블로그 게시물 남동, 호텔 preferir없습니다. [...]
January 27th, 2008 at 2:48 pm 2008년 1월 27일에서 오후 2시 48분
[...] Imagens para categorias. [...] 이미지 카테고리 이동합니다. Adiciona imagens para cada categoria do seu blog e são mostradas no post se você preferir. 각각의 범주 adiciona 이미지 이메일 서울시 종로구 mostradas하지 서으 블로그 게시물 남동, 호텔 preferir없습니다. [...]
March 9th, 2008 at 12:13 am 2008년 3월 9일에서 오전 12시 13분
[...] Show Category Images (Source: [...] [...] 분류보기 이미지 (출처 : [...]
March 13th, 2008 at 12:40 am 2008년 3월 13일에서 오전 12시 40분
[...] Show Category Images (Source: [...] [...] 분류보기 이미지 (출처 : [...]
March 13th, 2008 at 1:51 am 2008년 3월 13일에서 오전 1시 51분
[...] Show Category Images (Source: [...] [...] 분류보기 이미지 (출처 : [...]
March 16th, 2008 at 6:43 pm 2008년 3월 16일에서 오후 6시 43분
[...] 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) 카테고리보기 이미지 - 간단한 코드를 추가하는 방법을 wordpress 템플릿과 연결된 이미지를 만들어 귀하의 범주를 게시물에 대한 텍스트 대신에 나타납니다. [...]
March 17th, 2008 at 9:40 am 2008년 3월 17일에서 오전 9시 40분
Great hack! 큰 해킹! thanks 감사합니다
March 23rd, 2008 at 7:40 am 2008년 3월 23일에서 오전 7시 40분
[...] Show Category Images (Source: [...] [...] 분류보기 이미지 (출처 : [...]
April 12th, 2008 at 12:18 pm 2008년 4월 12일에서 오후 12시 18분
[...] 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 [...] 10) 범주 이미지를 표시 - 간단한 코드를 추가하는 방법을 wordpress 템플릿을 만들어 [...] 링크된 이미지 대신에 나타납니다
April 15th, 2008 at 2:02 am 2008년 4월 15일에서 오전 2시 2분
Hi 안녕
here is a plugin that do the job : 여기에 플러그 접속하는 일을 :
Category Icons Plugin 범주 아이콘 플러그 접속식 . 합니다.
April 19th, 2008 at 10:47 am 2008년 4월 19일에서 오전 10시 47분
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 2008년 4월 21일에서 오전 9시 2분
[...] : JTPRATT’s Blogging Mistakes ( here & here ), Performancing Helping Bloggers [...] [...] : jtpratt의 블로그의 실수는 (여기서 & 여기에), Performancing - 도움이 블로거 [...]
April 27th, 2008 at 9:50 am 2008년 4월 27일에서 오전 9시 50분
[...] 84. [...] 84. No More CSS Hacks. 더 이상 전투 근무 지원 hacks합니다. 85. Create a Dynamic Sticky. 동적 스티커를 만듭니다. 86. Styling Individual Posts Using the_ID. the_id를 사용하여 개별 게시물 스타일링합니다. 87. Show Category Images. 분류 이미지를 표시합니다. 88. Separate WordPress Comments and Trackbacks. 별도의 wordpress 코멘트와 트랙백합니다. 89. Customize your WordPress Login. 사용자 정의 wordpress 로그인합니다. 90. Date Image [...] 날짜 이미지를 [...]
May 16th, 2008 at 2:26 am 2008년 5월 16일에서 오전 2시 26분
[...] 84. [...] 84. No More CSS Hacks 85. 더 이상 hacks 85 전투 근무 지원합니다. Create a Dynamic Sticky 86. 86 동적 스티커를 만듭니다. Styling Individual Posts Using the_ID 87. the_id를 사용하여 개별 게시물 스타일링 87. Show Category Images 88. 분류 이미지를 표시 88. Separate WordPress Comments and Trackbacks 89. 별도의 wordpress 코멘트와 트랙백 89. Customize your WordPress Login 90. 사용자 정의 wordpress 로그인 90. Date Image [...] 날짜 이미지를 [...]
June 6th, 2008 at 4:38 am 2008년 6월 6일에서 오전 4시 38분
[...] Hacks84. [...] hacks84합니다. No More CSS Hacks85. 더 이상 전투 근무 지원 hacks85합니다. Create a Dynamic Sticky86. 동적 sticky86을 만듭니다. Styling Individual Posts Using the_ID87. the_id87를 사용하여 개별 게시물 스타일링합니다. Show Category Images88. 분류 images88 표시합니다. Separate WordPress Comments and Trackbacks89. 별도의 wordpress 의견과 trackbacks89합니다. Customize your WordPress Login90. wordpress login90을 맞춤 구성하십시오. Date Image [...] 날짜 이미지를 [...]