{"id":175342,"date":"2014-05-01T14:50:52","date_gmt":"2014-05-01T05:50:52","guid":{"rendered":"https:\/\/ja.wordpress.org\/support\/2014\/05\/01\/%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%ef%bc%88archivephp%ef%bc%89%e3%81%ae%e3%83%9a%e3%83%bc%e3%82%b8%e9%80%81%e3%82%8a\/"},"modified":"2014-05-01T14:50:52","modified_gmt":"2014-05-01T05:50:52","slug":"%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%ef%bc%88archivephp%ef%bc%89%e3%81%ae%e3%83%9a%e3%83%bc%e3%82%b8%e9%80%81%e3%82%8a","status":"closed","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%ef%bc%88archivephp%ef%bc%89%e3%81%ae%e3%83%9a%e3%83%bc%e3%82%b8%e9%80%81%e3%82%8a\/","title":{"rendered":"\u30ab\u30c6\u30b4\u30ea\uff08archive.php\uff09\u306e\u30da\u30fc\u30b8\u9001\u308a"},"content":{"rendered":"<p>\u3064\u3044\u6700\u8fd1\u52c9\u5f37\u306e\u305f\u3081WordPress\u3092\u59cb\u3081\u307e\u3057\u305f\u3002<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u5143\u3005\u5165\u3063\u3066\u3044\u308bDefault\u30c6\u30fc\u30de\u3092\u4f7f\u7528\u3057\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30ab\u30c6\u30b4\u30ea\u5225\u8868\u793a\u3092\u884c\u3063\u305f\u969b\u3001\u30da\u30fc\u30b8\u9001\u308a\u304c\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n1\u30da\u30fc\u30b8\u76ee\u3057\u304b\u8868\u793a\u3055\u308c\u305a\u30012\u30da\u30fc\u30b8\u76ee\u4ee5\u964d\u306e\u30ea\u30f3\u30af\u306a\u3069\u3082\u306a\u3044\u306e\u30671\u30da\u30fc\u30b8\u5206\u3057\u304b\u8aad\u307f\u8fbc\u307e\u308c\u3066\u3044\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u540c\u3058\u300carchive.php\u300d\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u6708\u5225\u8868\u793a\u3067\u306f\u554f\u984c\u306a\u304f\u30da\u30fc\u30b8\u9001\u308a\u304c\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u300cWP-PageNavi\u300d\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3068\u30da\u30fc\u30b8\u9001\u308a\u304c\u3067\u304d\u306a\u3044\u4e0d\u5177\u5408\u304c\uff65\uff65\uff65\u3068\u3044\u3046\u4e8b\u4f8b\u304c\u591a\u3044\u3068\u77e5\u308a\u8abf\u3079\u307e\u3057\u305f\u304c\u5909\u5316\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u305f\u3060\u3001\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u60aa\u3044\u306e\u304b\u3001\u305d\u306e\u4ed6\u306a\u306e\u304b\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b<br \/>\nDefault\u30c6\u30fc\u30de\u3067\u5143\u3005\u8a18\u8ff0\u3055\u308c\u3066\u3044\u305f<br \/>\n<code>&lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link(__(&#039;&amp;laquo; Older Entries&#039;, &#039;kubrick&#039;)); ?&gt;&lt;\/div&gt;<\/code><br \/>\n<code>&lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link(__(&#039;Newer Entries &amp;raquo;&#039;, &#039;kubrick&#039;)); ?&gt;&lt;\/div&gt;<\/code><br \/>\n\u3053\u306e\u95a2\u6570\u3092\u8a18\u8ff0\u3057\u3066\u3082\u30ab\u30c6\u30b4\u30ea\u5225\u8868\u793a\u3067\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u539f\u56e0\u3067\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u6708\u5225\u3068\u30ab\u30c6\u30b4\u30ea\u5225\u3001\u540c\u3058\u300carchive.php\u300d\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u306e\u306b\u4f55\u6545\u30ab\u30c6\u30b4\u30ea\u5225\u3067\u306f\u30da\u30fc\u30b8\u9001\u308a\u304c\u3067\u304d\u306a\u3044\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n\u512a\u5148\u5ea6\u7684\u306b\u306f\u30ab\u30c6\u30b4\u30ea\u5225\u3067\u306e\u8868\u793a\u3092\u884c\u3044\u305f\u3044\u306e\u3067\u3059\u304c\u3002\u3002<\/p>\n<p>\u5ff5\u306e\u305f\u3081\u3001archive.php\u306e\u5185\u5bb9\u3092\u8a18\u8f09\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre><code>&lt;?php\n\/**\n * @package WordPress\n * @subpackage Default_Theme\n *\/\n\nget_header();\n?&gt;\n\n\t&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot; role=&quot;main&quot;&gt;\n\n&lt;?php if (have_posts()) : ?&gt;\n\n \t  &lt;?php $post = $posts[0]; \/\/ Hack. Set $post so that the_date() works. ?&gt;\n \t  &lt;?php \/* If this is a category archive *\/ if (is_category()) { ?&gt;\n\t\t&lt;h2 class=&quot;pagetitle&quot;&gt;&lt;span&gt;&lt;?php printf(__(&#039;\u300c%s\u300d\u306b\u3064\u3044\u3066&#039;, &#039;kubrick&#039;), single_cat_title(&#039;&#039;, false)); ?&gt;&lt;\/span&gt;&lt;\/h2&gt;\n \t  &lt;?php \/* If this is a tag archive *\/ } elseif( is_tag() ) { ?&gt;\n\t\t&lt;h2 class=&quot;pagetitle&quot;&gt;&lt;span&gt;&lt;?php printf(__(&#039;Posts Tagged &#8216;%s&#8217;&#039;, &#039;kubrick&#039;), single_tag_title(&#039;&#039;, false) ); ?&gt;&lt;\/span&gt;&lt;\/h2&gt;\n \t  &lt;?php \/* If this is a daily archive *\/ } elseif (is_day()) { ?&gt;\n\t\t&lt;h2 class=&quot;pagetitle&quot;&gt;&lt;span&gt;&lt;?php printf(_c(&#039;Archive for %s|Daily archive page&#039;, &#039;kubrick&#039;), get_the_time(__(&#039;F jS, Y&#039;, &#039;kubrick&#039;))); ?&gt;&lt;\/span&gt;&lt;\/h2&gt;\n \t  &lt;?php \/* If this is a monthly archive *\/ } elseif (is_month()) { ?&gt;\n\t\t&lt;h2 class=&quot;pagetitle&quot;&gt;&lt;span&gt;&lt;?php printf(_c(&#039;Archive for %s|Monthly archive page&#039;, &#039;kubrick&#039;), get_the_time(__(&#039;F, Y&#039;, &#039;kubrick&#039;))); ?&gt;&lt;\/span&gt;&lt;\/h2&gt;\n \t  &lt;?php \/* If this is a yearly archive *\/ } elseif (is_year()) { ?&gt;\n\t\t&lt;h2 class=&quot;pagetitle&quot;&gt;&lt;span&gt;&lt;?php printf(_c(&#039;Archive for %s|Yearly archive page&#039;, &#039;kubrick&#039;), get_the_time(__(&#039;Y&#039;, &#039;kubrick&#039;))); ?&gt;&lt;\/span&gt;&lt;\/h2&gt;\n\t  &lt;?php \/* If this is an author archive *\/ } elseif (is_author()) { ?&gt;\n\t\t&lt;h2 class=&quot;pagetitle&quot;&gt;&lt;span&gt;&lt;?php _e(&#039;Author Archive&#039;, &#039;kubrick&#039;); ?&gt;&lt;\/span&gt;&lt;\/h2&gt;\n \t  &lt;?php \/* If this is a paged archive *\/ } elseif (isset($_GET[&#039;paged&#039;]) &amp;&amp; !empty($_GET[&#039;paged&#039;])) { ?&gt;\n\t\t&lt;h2 class=&quot;pagetitle&quot;&gt;&lt;span&gt;&lt;?php _e(&#039;Blog Archives&#039;, &#039;kubrick&#039;); ?&gt;&lt;\/span&gt;&lt;\/h2&gt;\n \t  &lt;?php } ?&gt;\n\n\t\t&lt;div class=&quot;navigation&quot;&gt;\n\t\t\t&lt;?php if(function_exists(&#039;wp_pagenavi&#039;)) { wp_pagenavi(); } ?&gt;\n\t\t&lt;\/div&gt;\n\n\t\t&lt;?php while (have_posts()) : the_post(); ?&gt;\n\t\t&lt;div &lt;?php post_class(); ?&gt;&gt;\n\t\t\t\t&lt;h2 id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php printf(__(&#039;Permanent Link to %s&#039;, &#039;kubrick&#039;), the_title_attribute(&#039;echo=0&#039;)); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h2&gt;\n&lt;hr \/&gt;\n\t\t\t\t&lt;div class=&quot;entry&quot;&gt;\n\t\t\t\t\t&lt;?php the_content() ?&gt;\n\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;?php the_category(); ?&gt;\n\t\t\t\t&lt;p class=&quot;postmetadata&quot;&gt;&lt;?php the_time(&#039;Y.m.d&#039;); ?&gt;&lt;\/p&gt;\n\t\t\t&lt;\/div&gt;\n\n\t\t&lt;?php endwhile; ?&gt;\n\n\t\t&lt;div class=&quot;navigation&quot;&gt;\n\t\t\t&lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link(__(&#039;&amp;laquo; Older Entries&#039;, &#039;kubrick&#039;)); ?&gt;&lt;\/div&gt;\n\t\t\t&lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link(__(&#039;Newer Entries &amp;raquo;&#039;, &#039;kubrick&#039;)); ?&gt;&lt;\/div&gt;\n\t\t\t&lt;?php if(function_exists(&#039;wp_pagenavi&#039;)) { wp_pagenavi(); } ?&gt;\n\t\t&lt;\/div&gt;\n\t&lt;?php else :\n\n\t\tif ( is_category() ) { \/\/ If this is a category archive\n\t\t\tprintf(&quot;&lt;h2 class=&#039;center&#039;&gt;&quot;.__(&quot;Sorry, but there aren&#039;t any posts in the %s category yet.&quot;, &#039;kubrick&#039;).&#039;&lt;\/h2&gt;&#039;, single_cat_title(&#039;&#039;,false));\n\t\t} else if ( is_date() ) { \/\/ If this is a date archive\n\t\t\techo(&#039;&lt;h2&gt;&#039;.__(&quot;Sorry, but there aren&#039;t any posts with this date.&quot;, &#039;kubrick&#039;).&#039;&lt;\/h2&gt;&#039;);\n\t\t} else if ( is_author() ) { \/\/ If this is a category archive\n\t\t\t$userdata = get_userdatabylogin(get_query_var(&#039;author_name&#039;));\n\t\t\tprintf(&quot;&lt;h2 class=&#039;center&#039;&gt;&quot;.__(&quot;Sorry, but there aren&#039;t any posts by %s yet.&quot;, &#039;kubrick&#039;).&quot;&lt;\/h2&gt;&quot;, $userdata-&gt;display_name);\n\t\t} else {\n\t\t\techo(&quot;&lt;h2 class=&#039;center&#039;&gt;&quot;.__(&#039;No posts found.&#039;, &#039;kubrick&#039;).&#039;&lt;\/h2&gt;&#039;);\n\t\t}\n\t  get_search_form();\n\tendif;\n?&gt;\n\t&lt;\/div&gt;\n\n&lt;?php get_sidebar(); ?&gt;\n&lt;?php get_footer(); ?&gt;<\/code><\/pre>\n<p>\u304a\u624b\u6570\u3067\u3059\u304c\u3001\u4f55\u5352\u3054\u52a9\u8a00\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"template":"","class_list":["post-175342","topic","type-topic","status-closed","hentry","topic-tag-archive","topic-tag-15726","topic-tag-14546","topic-tag-category"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/175342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/175342\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=175342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}