Wordpress Hack #2: How To Create A Master Archive Index Page Wordpressのハッキング# 2 :どのようにマスターアーカイブインデックスのページを作成するには
1,588 views - 1,588ビュー-著 でPosted in: の投稿:
1,588 views 1,588ビュー
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”!これが私たちの30 "ハック- Wordpressのハック# 2にある討論" ! That’s right, I’m going to give you oneそのとおり、私はあなたを与えるつもりだ Wordpress hack per day for 30 days Wordpressの1日の 30 日間のハッキング , 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.のRSSフィードを登録してくださいまたは、メールでは、ページの上部にある購読してください。
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.ホームページと9の抜粋記事を1つの完全なポストしている。 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.私は現在、検索クローラが)ので、本当にすべてのコンテンツの鳥の目のビューを取得する方法はありません(だけでは、 XMLのサイトマップをHTML Webページのサイトマップがありません。 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.あなたのテーマや、現在は、投稿をしていただけに、今年のか月にお客様のサイドバーにリンクされますアーカイブページベースの任意の1か月以上表示されない場合があります。 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 "を使用しているそうであるならば、インデックス、検索、カテゴリー、タグのページを行うのと同じ方法-最大1 0の投稿には、時のリスト'時間'と'には、ページの下部にある次のリンクを前。 In my experience, most themes don’t have a master archive page (or what the私の経験では、ほとんどのテーマは、マスタのアーカイブページを持っていない(または何が Wordpress Codex calls the “Archive Index”ワードプレスコデックス" "アーカイブインデックスの通話 , 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).あなたのテーマは、あなたの" page.php "ファイルの名前を変更コピーをダウンロードして" archives.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>' )<?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>
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.基本的にこの問題を解決するために、 2つの異なる方法で、実際にこれらのソリューションを組み合わせることができますしている。 The first thing we can do is get a Wordpress plugin for archives to get more options on this page.私たちにできることは、まずアーカイブについては、このページにさらに多くのオプションを取得するには、 Wordpressのプラグインを取得しています。 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. 2つ目は少しハッキングを行うにされており、訪問者のページには確かに必要なすべてのオプションを取得するために必要なデータベースの情報を得るにいくつかのコードを追加します。
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レスターチャンプラグインWPを採用- 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のループ"の外で私のマスターアーカイブインデックスのページを追加するには、このコードを追加しています( WP_PostViews私のWordpressのインストールでは、プラグインとして)がインストールされて以来、私はすでに:
<h2>Top 25 Most Viewed Posts</h2> <?php if (function_exists('get_most_viewed')): ?> <?php get_most_viewed('both', 25) ?> <?php endif; ?> <br /><br /> 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これを行うにはあなたの面倒を見るかもしれないもう1つの方法を使用している 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, 、私は2つの非常に似たようなWordpressのプラグインが見つかりましたアーカイブもう少し研究して SRG Clean Archives swissinfoにクリーンアーカイブ , 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.上部にあるので、便利なドロップダウンしている私のマスターアーカイブインデックスのページには、訪問者の迅速ヶ月1ヶ月またはすべての記事を参照してくださいすぐにアーカイブすることができます。 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" /> 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. Readmeファイルには他の多くのオプションの場合、このプラグインをダウンロードして、私は、現在の月最初に表示するために選んだ。 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.を選択すれば彼らは1つのページ上のすべての記事を見ることができます。 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:タグ: archivesアーカイブ , 、 pluginプラグイン , 、 tutorialチュートリアル , 、 wordpress-hacksワードプレスのハッキング




















June 19th, 2008 at 6:38 am 6月19日、 2008年で、午前6時38分
most awful blogging mistake: automatic translation.最もひどいブログミス:自動翻訳。 it really SUCKS BIG TIME.本当にビッグタイムを採る。 I want to read your blog in english, idiot.私はあなたのブログを読むには、ばか英語。
June 19th, 2008 at 7:46 am 6月19日、 2008年で、午前七時46
@fdas - I don’t use or have automatic translation on this blog - you have to click one of the translation icons to get a translated page. @ fdas -私を使用していないか、このブログに自動翻訳している-場合は、翻訳のアイコンをクリックして1つに翻訳のページを取得する必要があります。 Every single page is available by default in English.ごとに1つのページは英語ではデフォルトでは入手可能です。
The idiot is the person that leaves a blog comment like this and uses random characters and a fake email address (you) so I can’t contact you and get to root of the issue you were having, and fix it for others if there was one.は、ばかでは、このようなブログにコメントを残すとはランダムな文字列と、偽のメールアドレスを使用している人だ(お客様)することはできませんので、ご連絡をされた場合、問題の根源になる、などがあった場合にそれを修正1 。
June 30th, 2008 at 5:49 pm 2008年6月30日の午後五時49分
Thanks for the info.情報をお寄せいただきありがとうございます。 After staring at the codex for an hour wondering why I didn’t have a “templates” box on my Write >> Page, I figured out that the 5 lines of code I ripped away from the top of the archives.php was the problem. 1時間、なぜ私は"私の書き込み> >ページの"ボックスのテンプレートを持っていなかったかの写本をじっとした後、私は離れたarchives.phpの上からリッピングのコードの5行が問題だったのを考え出した。
For the record, page displays in perfect English for me and I can only figure that the other jerk followed a link from another site or something.記録については、私にとって完璧な英語のページが表示されますと私だけが、他の反射か何か別のサイトからのリンクを割り出すことができる。
DrBrians last blog post.. DrBrians最後のブログの記事.. Pardon the Dust…恩赦は、ホコリ...
August 9th, 2008 at 10:07 am 2008年8月9日の午前10:07
Thanks for all your work; I am addicted.すべての仕事をしていただき、ありがとうございます。私ははまっている。 Can’t believe that guy could see all your work then gripe at you.男ならではの不満は、すべての作品を見る可能性があると考えていることができません。
Kims last blog post..金氏は最後のブログの記事.. Google Insights Tool Googleの洞察ツール