Wp Affiliate Pro - The #1 Plugin For WordPress Blogs 백린 제휴를위한 - 그 # 1 플러그 접속에 대한 wordpress 블로그
Powered by MaxBlogPress 의해 제공됩니다 maxblogpress

wordpress 해킹 # 2 : 마스터 아카이브 색인 페이지를 만드는 방법 | jtpratt의 블로그 실수를
블로깅의 실수 jtpratt


Home » Wordpress Hack #2: How To Create A Master Archive Index Page »wordpress 해킹 # 2 : 마스터 아카이브 색인 페이지를 만드는 방법을



Posted in: 게시 :

블로그 - 설치 프로그램을 범주 이미지분류 이미지를 wordpress
455 views 455 조회


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.


In your Wordpress blog do you have a sortable clean and easy way for visitors to access your previous posts? 귀하의 wordpress 블로그에 좀 있으세요 정렬 깨끗하고 편리한 방법을 방문자에게 이전 게시물에 액세스할 수있습니다? Other than the month based archive link in your sidebar, you may not have an archive index at all! 이번 달 이외의 사이드바에 기반 아카이브 링크를하실 수없습니다 아카이브 색인이 전혀! It’s time you hacked your own Master Archive Index Page! 그것은 시간이 자신의 마스터 아카이브 색인 페이지를 해킹!

This is Wordpress Hack #2 in our 30 “Hack-a-Thon”! 이것은 wordpress 해킹 # 2의 30 "해킹 - - thon"! That’s right, I’m going to give you one 맞습니다, 나는 당신에게 하나를 주겠다 Wordpress hack per day for 30 days 30 일 동안 하루에 wordpress 해킹 , and at the end of that time you will have pimped out your blog like you never would have believed possible! , 그리고 그 시간의 끝에 블로그에 아웃하셔야합니다 당신처럼 매혹 수 없었을 믿어! Be sure to signup for the RSS feed or subscribe by email at the top of the page. 의 피드를 반드시 등록하거나 등록 페이지의 상단에 이메일로합니다.

Out of the box the default Archives for Wordpress aren’t very sexy. wordpress의 기본 아카이브를 밖으로 상자에 매우 섹시함되지 않습니다. In fact, as I’ve mentioned in previous posts the word thing about Wordpress (to me) is the fact that the content seems hard to navigate, hard to get to, and downright self-defeating at times. 사실 나는 이전 게시물이라는 단어에서 언급한 점은 wordpress (나)는 콘텐츠 보인다는 사실을 하드로 이동, 접근하기 힘들다, 그리고 솔직한 자기 - 꺾고 때로합니다. Let’s take this blog as it stands right now as an example. 이 블로그를 보자 바로 지금 그것이 의미하는 바와을 예로합니다. The homepage has one full post and 9 excerpted posts. 전체 게시물의 홈페이지는 1 ~ 9 인용 게시물을합니다. The sidebar contains links to the last 10 posts, and most viewed posts, in addition to a link to categories and monthly archives. 사이드바는 지난 10 개의 게시물 링크를 포함, 대부분의 인기 게시물, 이외에의 링크를 카테고리 및 월별 보관합니다. I can also search, and those are my basic options for finding content. 나는 또한 검색 및 콘텐츠를 찾는 이들은 나의 기본적인 옵션을합니다. The custom pages I’ve setup also lead to some article series and categorized content. 설치 프로그램을 사용자 정의 페이지에 나는 어떤 기사 시리즈와도 연결되는 콘텐츠로 분류합니다. I currently don’t have an HTML web page site map (just an XML sitemap for search crawlers), so there really is no way to get a birds eye view of all my content. 현재 웹 페이지를 html이없는 경우 사이트 맵 (단순한 xml 사이트 맵 검색 크롤 러), 그래서 우리가 정말 새 눈을 끄는 방법이 문서가 적용되는 지역 내의 모든 콘텐츠를합니다. I’m rapidly approaching 100 posts, but at any give time you’re lucky to have more than 10-15 options for content as you surf around my blog. 나는 빠르게 접근하고 100 개의 게시물, 그러나 언제 당신은 행운을 줄 시간 이상의 콘텐츠를 인터넷 서핑 주위 10-15 내 블로그에 대한 옵션을합니다.

Your theme may or may not currently display any more than month based archive pages, which will just be links in your sidebar to the months of the year you had posts. 당신의 주제 현재하지 않을 수도있습니다 기반 아카이브 페이지에 표시됩니다 개월 이상이 사이드바에있는 링크를 기뻐할 올해의 당신이 게시물에 달합니다. Some themes also have a calendar. 일부 테마 캘린더도합니다. All these normally do is use your “archive.php” in your theme directory as a template to bring up a list of posts the same way you index, search, category, or tag pages do - a list of up 10 to posts at a time with ‘previous’ and ‘next’ links at the bottom of the page. 이러한 모든 정상적으로 사용할은 당신의 "archive.php"를 테마 디렉토리의 목록을 템플릿으로 사용하여 게시물의 제기를 같은 방식으로 색인, 검색, 카테고리, 또는 태그를 페이지를하지 - 게시물의 목록에서 10 ~ 시간을 '이전'및 '다음'링크의 아래쪽에있는 페이지를합니다. In my experience, most themes don’t have a master archive page (or what the 내 경험, 대부분의 테마가없는 마스터 아카이브 페이지 (또는 대체 Wordpress Codex calls the “Archive Index” wordpress 사본를 호출하는 "아카이브 인덱스" , although some have a “archives.php” file to create one from. 지만 일부는 "archives.php"파일을 만드는 중 하나를합니다. Notice that this template file has an “s” on archives.php. 이 템플릿을 통지하는 파일에는 "의"를 archives.php합니다. Look in your theme directory, and you should have a file named “archives.php”. 보고 당신의 주제 디렉토리, 그리고 당신라는 이름의 파일이 있어야한다 "archives.php"합니다. If you do add the first 5 lines below at the very top of that file, and the rest of the code in “the loop” of that page (after the header and before the endwhile). 첫 5 선면 아래에 추가하여 해당 파일을 맨 위에, 그리고 나머지 부분의 코드는 "루프"의 페이지 (이후에 헤더 및 이전에 endwhile). If for some reason your theme doesn’t have an archives.php, just download a copy of your “page.php” file, rename and save it as “archives.php” and then add these code to it (then upload to your theme directory). 만약 어떤 이유로 당신의 주제가가없는 archives.php, 그냥의 복사본을 다운로드 당신의 "page.php"파일 이름을 변경하여 저장하고, "archives.php"을 선택한 다음 이들의 코드를 추가할 그것 (그 때 당신의 업로드를 주제 디렉토리).

 <?php /* Template Name: Master Archives Page */ ?>  <h2>Archives by Month:</h2>   <ul>     <?php wp_get_archives('type=monthly'); ?>   </ul>  <br /> <h2>Archives by Subject:</h2>   <ul>      <?php wp_list_cats(); ?>   </ul> <함수 / * 서식 파일 이름 : 마스터 아카이브 페이지 * /?> <h2> 기록 보관소를 달 : </ h2> <ul> <함수 wp_get_archives ( '유형 = 월간');?> </ ul> <브롬 / > <h2> 기록 보관소 제목 : </ h2> <ul> <함수 wp_list_cats ();?> </ ul> 

페이지 템플릿 예제 Make sure you have the “Template Name” in the top. 가 설치되어 있는지 확인하십시오 "템플릿 이름"위. Now upload this file to your theme directory, and in your Wordpress dashboard go to “Write -> Page”. 지금 당신의 주제 디렉토리에이 파일을 업로드, 그리고 wordpress 대시보드로 이동하여 "쓰기 -> 페이지"합니다. On the right hand side you’ll see “page template” as in the image example here. 오른쪽에 나타납니다 "페이지 템플릿"으로의 이미지를 예제는 여기에있습니다. Just select “Master Archives Page”. 을 선택하고 "마스터 아카이브 페이지"합니다. I’m going to call mine “Archived Posts Sitemap”. 광산을 부를께요 "기록된 게시물 사이트맵"합니다. I like that title because it says it’s an archive page with a sitemap. 마음에 들어, 제목 페이지에 보관하기 때문에 말한다 이것은 사이트맵합니다. To me a sitemap is a great big categorized page of titles and links where you can get a the big picture of a site pretty quickly. 나에게는 큰 분류 페이지의 사이트맵 제목과 링크가 어디로 사이트의 큰 그림을 잡을 수있다 매우 신속하게합니다. That’s the impression I want to give people, unlike the monthly archive pages that just list posts and excerpts. 그것은 사람들이 인상을주고 싶어요과 달리, 매달 기록 보관소 페이지가 단지리스트 게시물 및 발췌합니다. The first time creating this page I’m not going to give it much content - just some introductory content. 이번이 처음이 페이지를 작성하지 않을 나는별로 관심이 콘텐츠를 - 단지 일부 콘텐츠를 소개합니다. Save this page and then reload your site in another tab or window. 이 페이지를 저장하고 다음을 또 다른 탭 또는 윈도우에서 귀하의 사이트에 다시로드합니다. You should see the name of this new page in your “Pages” in your sidebar. 이 새 페이지의 이름이 나타납니다에서 당신의 "페이지"의 사이드바합니다. Click on it to bring it up and you should have something like this: 그리고 그것을 들어올려를 클릭하십시오해야 적들역시 :

아카이브 색인 예제

You see in that example what you get is a listing of archives by month, and also by subject (category). 이 예제에서 보는 건 당신 월별 아카이브 목록을, 그리고 의해 제목 (범주). This really sucks doesn’t it!? 정말 끝장하지 않습니다!? I mean come on, everyone already has both of these already in their sidebar - I do! 내 말은 자, 모두가 이미 두 이미 그들의 사이드바 - 할 수있어! There are basically two different ways to solve this problem, and actually these solutions can be combined. 기본적으로이 두 개의 서로 다른 방법으로이 문제를 해결하기, 그리고 사실은 이러한 솔루션은 조합하여 사용할 수있습니다. The first thing we can do is get a Wordpress plugin for archives to get more options on this page. 먼저 우리가 할 수있는 일은 좀 더 많은 옵션을 위해 플러그 접속식이 페이지를 보관합니다. The second is to do a little hackng and add some code to the page to get the information out of the database we need to make sure visitor’s get all the options they need. 두 번째는 이렇게 약간 hackng를 추가하는 정보를 얻는 데에 일부 코드를 페이지에 데이터베이스를 밖으로 방문자의 모두가 필요로하는 옵션 있는지 확인이 필요합니다.

After reviewing my options - these are my thoughts… 저의 옵션을 검토한 후 - 이것은 내 생각이…

I “could” use yesterday’s 나는 "이"어제의 사용 query_posts hack 해킹 query_posts to list every post I have on the page - but that wouldn’t be very nice visually at all. 나는 페이지에있는 모든 게시물을 나열 - 그러나 그것은 아주 좋은 시각적으로 전혀되지 않습니다. I think it would be great to give visitor’s most “most viewed” or “most popular” posts on this page. 에게 좋을 것 같아 방문자의 대부분의 "최다 조회"또는 "인기있는"게시물에이 페이지를합니다. I already have the most viewed top 10 in my sidebar. 나는 이미 내 사이드바 최다 조회 최고 10. I use the 나는를 사용하여 Lester Chan Plugin WP-PostViews 레스터의 플러그 접속식 백린 - postviews to get this. 를 본합니다. It will display the most viewed posts, or most viewed posts for a category. 가장 많이 본 게시물을 표시하는이, 또는 가장 많이 본 게시물을 분류합니다. I’m going to use it to display the top 25 most viewed posts. 나는 그것을 이용하려고 상위 25 최다 조회 게시물을 표시합니다. That’s more than I have in my sidebar and should be very useful to visitor’s. 내 사이드바에 대해 좀 더하고 나는 매우 유용하게 방문자가되어야합니다. According to the 에 따르면 WP_PostViews documentation wp_postviews 설명서 all I need to do is add this code “outside the loop” of my archives.php to add this to my Master Archives Index Page (since I already ahve WP_PostViews installed as a plugin in my Wordpress installation): 모든 나는이 코드를 추가할 필요가 "외부는 루프"을 내 archives.php 이것을 나의 주인 아카이브 색인 페이지를 추가 (플러그인을 설치한 이후에 이미 내 wordpress 설치를 wp_postviews) :

 <h2>Top 25 Most Viewed Posts</h2> <?php if (function_exists('get_most_viewed')): ?>    <?php get_most_viewed('both', 25) ?> <?php endif; ?> <br /><br /> <h2> 상위 25 최다 조회 게시물 </ h2> <함수 경우 (function_exists ( 'get_most_viewed')) :?> <함수 get_most_viewed ( '둘 다', 25)?> <함수 endif;?> <브롬 / > </> 

Since you have to use that code outside the loop, and I have a page heading just inside the loop on my archives.php, I decided to place this after the loop in my Master Archives Index page. 이후 밖으로 해당 코드를 사용하면 루프, 그리고 그것이 페이지를 표제 루프 내부의 단지 내 archives.php, 나 루프 이후에 이것을 배치 결정 제 마스터 아카이브 색인 페이지합니다. Another way to do this you might care for is by using the 이렇게하려면 관리에 대한 또 다른 방법은 수도를 사용하여 using the Top Post plugin 플러그인을 사용하여 상위 게시물 by JohnTP to display the top post by category like he does on johntp를 표시하는 상위 범주별로 의해 같은 게시물에 그는 his top posts page 그의 위로 포스트 페이지 . 합니다. I decided to stick with what I have so far. 나는 지금까지 내가 갖고하기로했다 붙어합니다.

Doing a little more research I found two very similar Wordpress Archiving Plugins, 조금 더 연구하는 두 개의 매우 유사 찾았 wordpress 보관 플러그인, SRG Clean Archives srg 클린 기록 보관소 , and , 그리고 Smart Archives 스마트 아카이브 . 합니다. They basically do the same thing, just formatted a little differently. 그들은 기본적으로 똑같이 할, 그냥 형식의 약간 다르게합니다.

Here’sa clean archives example where you’ll see that you get monthly archives with linked titles and post counts. 다음은 어디로 청소 기록 보관소 예 매달 기록 보관소 잡았다고 생각 연결된 볼 게시물 제목과 계산합니다. It also shows the day posted before and comment count after each linked title. 또한 게시하기 전에 보여주는 하루 제목이나 코멘트 카운트 후 각 연결합니다.

클린 아카이브 예제

In the Smart Archives plugin example you’ll see an addition of a linked calendar above the posts by year and month. 이 기록 보관소의 스마트 플러그 접속식 예제에 연결하면 달력을 볼 수 위의 이외의 게시물을 구분할 수있습니다. The posts are also listed by month. 월별로 게시물도 나와있습니다. With this plugin you don’t get date posted or comment count. 이 플러그인을 게시하거나 코멘트를 얻을 수는 없어 날짜 계산합니다.

스마트 아카이브 예제

In the end I wanted to go with something I thought was not only a bit more cool, but much more user-friedly. 결국은 뭔가를하고 싶어 나는 생각이 조금 더 멋진뿐만 아니라,하지만 훨씬 더 사용자 - friedly합니다. I really wanted to use 정말로 사용하고 싶었 Exended Live Archive exended 라이브 아카이브 because of the interface, but it’s not compatible with Wordpress 2.3+ at all. 때문에 인터페이스,하지만 그건 wordpress 2.3 +를 모두와 호환되지 않습니다.

In the end I went with 결국에 갔었 KG Archives 킬로그램 기록 보관소 for my Master Archives Index page because it has a handy drop down at the top where visitor’s can quickly choose to see one month or all months quickly of archived posts. 아카이브 색인 페이지에 대한 나의 주인이 편리하기 때문에 방문자의 드롭 다운 목록 상단에 위치 한 달 또는 모두 볼 수있습니다 개월 신속하게 신속하게 선택하여 게시물을 보관합니다. In addition this post lists the date posted and comment count for each as well. 또한 해당 게시물 및 덧글을 나열합니다 카운트를 각각 게시 날짜도합니다.

킬로그램 기록 보관소 예제

To place the KG Archives content on your Master Archive Index Page you just have to copy and paste the following code - but this time go back and “edit” your actual “page” in “Manage->Pages” where you wrote the intro content, and paste this beneath (in code view): 귀하의 마스터를 넣습니다 킬로그램 아카이브 색인 페이지의 콘텐츠를 보관하기만하면 다음과 같은 코드를 복사하여 붙여 넣습니다 -하지만 이번에는 뒤로하고 "수정"을 귀하의 실제 "페이지"의 "관리 -> 페이지"를 쓴 사람은 어디로 콘텐츠를 소개 , 그리고이 아래에 붙여넣기 (코드 뷰) :

 <kgarchives initialmonth="current" /> <kgarchives initialmonth="current" /> 

I removed the original code I added at the beginning of this hack tutorial to get archives by month or subject in favor of the KG Archives sortable archive code. 나는 코드를 제거하고 원래의 시작 부분에 추가했는데,이 자습서를 해킹 또는 주제에 찬성 월별 아카이브 아카이브 코드의 킬로그램 아카이브 정렬합니다. Based on all the options I presented to you in this post - you must decide which of all the layouts and plugins you like best for your archives index page. 모든 옵션을 기반으로 나는이 지점을 발표 - 당신의 모든 필요를 결정하는 레이아웃 및 플러그인을 위해 최선을 같이 귀하의 아카이브 색인 페이지합니다. View my new 이 문서가 적용되는 새 Archived Posts Sitemap page here 사이트 맵 페이지를 여기에 보관된 게시물 !

There are many other options in the readme file if you download this plugin, I chose to only display the current month at first. 다른 옵션도 많습니다 정보 파일에이 플러그인을 다운로드하는 경우, 전 달 현재의 선택을 처음에만 표시합니다. Now I have a Master Archive Index Page where users can navigate all my past posts quickly and easily. 지금은 마스터 아카이브 색인 페이지를 사용자가 내 과거의 모든 게시물을 빠르고 쉽게 탐색할 수있습니다. They can even see all posts on one page if they choose. 그들은 한 페이지에 모든 게시물을 볼 수도있습니다 만약 그들이 선택합니다. I’ve also listed my most popular posts. 나는 또한 내 가장 인기있는 게시물을 나열합니다. If I keep adding pages, I may also expand my Archive Index to include a listing of all my parent and child pages at the very bottom. 만일 계속 추가 페이지, 나는 내 아카이브 색인을 포함하는 수도있습니다 목록을 확장합니다 내 부모와 아이의 모든 페이지에 바로 아래쪽합니다. Create your own archive index now! 자신의 아카이브 색인을 만드십시오하세요! I gave you plenty of options, and as always if you have something to add or a question - please comment now! 난 당신 한테 많은 옵션을 제공하며 항상 무언가를 추가 또는 질문이 있으면 - 제발 코멘트를하세요!


Tags: 태그 : , , ,

Question or Comment?? 질문이나 코멘트를?가? Spill it Now... 누출 지금은 ...

기쁨을 통해 의견을 점프!

We Reward Comments! 우리가 보상 코멘트!


We dofollow links, and get your latest blog post as a byline under every new comment from the "CommentLuv" plugin! 우리가 dofollow 링크, 그리고 당신의 최신 블로그 게시물 작성자 표시줄 아래로 매일 새로운 코멘트에서 "commentluv"플러그 접속식! Top commenters for every month are listed on every page of this site in a sidebar widget linked back to your URL! 매월 commenters에 대한 상위는 본 사이트의 모든 페이지에 나와 위젯을 사이드바에 연결된 위로하십시오! 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! 귀하의 게시물을 클릭하여 장바구니에 웃음! == []^ = (= ((= (|=) 연구= | 8= 0= 0) ~= 00= (=;;= 0)]=;;;