{"id":1410,"date":"2017-03-03T21:44:11","date_gmt":"2017-03-03T12:44:11","guid":{"rendered":"http:\/\/www.clarenet.co.jp\/column\/engineer\/?p=611"},"modified":"2017-03-03T21:44:11","modified_gmt":"2017-03-03T12:44:11","slug":"wp%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%ef%bc%9awp-pagenavi","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/wp%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%ef%bc%9awp-pagenavi\/","title":{"rendered":"WP\u30d7\u30e9\u30b0\u30a4\u30f3\uff1aWP-PageNavi"},"content":{"rendered":"<p>\u4eca\u56de\u306fWP\u306e\u6295\u7a3f\u306b\u7c21\u5358\u306b\u30da\u30fc\u30b8\u9001\u308a\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3067\u304d\u308b\u30d7\u30e9\u30b0\u30a4\u30f3<br \/>\n\u300cWP-PageNavi\u300d\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u4e0b\u8a18\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3057\u3087\u3046\u3002\u516c\u5f0f\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\u306e\u3067\u3001\u7ba1\u7406\u753b\u9762\u304b\u3089\u3082\u8ffd\u52a0\u53ef\u80fd\u3067\u3059\u3002<br \/>\n<a href=\"https:\/\/ja.wordpress.org\/plugins\/wp-pagenavi\/\" target=\"_blank\">https:\/\/ja.wordpress.org\/plugins\/wp-pagenavi\/<\/a><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u7ba1\u7406\u753b\u9762\u306e\u300c\u8a2d\u5b9a\u300d\u304b\u3089\u8a73\u7d30\u8a2d\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u30c6\u30fc\u30de\u306b\u8a2d\u7f6e\u3059\u308b\u969b\u306f\u3001\u4e0b\u8a18\u3092\u8a2d\u7f6e\u3057\u305f\u7b87\u6240\u306b\u30da\u30fc\u30b9\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"lang:default decode:true \" >&lt;?php wp_pagenavi(); ?&gt;<\/pre>\n<p>\u3082\u3057\u4e0a\u624b\u304f\u52d5\u304b\u306a\u3044\u3001\u8868\u793a\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u65b9\u304c\u3044\u305f\u3089\u3001<br \/>\n\u307e\u305a\u306f\u7ba1\u7406\u753b\u9762\u306e\u300c\u8a2d\u5b9a\uff1e\u8868\u793a\u8a2d\u5b9a\u300d\u30671\u30da\u30fc\u30b8\u306b\u8868\u793a\u3059\u308b\u8a18\u4e8b\u6570\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u3001\u56fa\u5b9a\u30da\u30fc\u30b8\u306bWP_Query\u3092\u4f7f\u3063\u3066\u30b5\u30d6\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u3001<br \/>\nwp_pagenavi\u306b\u30b5\u30d6\u30eb\u30fc\u30d7\u306e\u60c5\u5831\u3092\u5f15\u6570\u3067\u6e21\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" >&lt;?php\n $paged = get_query_var('paged'); \/\/\u30da\u30fc\u30b8\u6570\u3092\u53d6\u5f97\n $arg = array(\n    'post_type' =&gt; 'post', \/\/\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u306e\u5834\u5408\u306f\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\n    'posts_per_page' =&gt; 10, \/\/1\u30da\u30fc\u30b8\u306b\u8868\u793a\u3059\u308b\u6295\u7a3f\u6570\n    'order' =&gt; 'DESC', \/\/\u964d\u9806\n    'paged' =&gt; $paged \/\/\u30da\u30fc\u30b8\u6570\u3092\u53d6\u5f97\n\t);\n $my_query = new WP_Query($arg);\n    if($my_query-&gt;have_posts()): \n?&gt;\n   \n   &lt;ul&gt;\n   \n    &lt;?php while($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;\n\n         &lt;li&gt;&lt;a href=\"&lt;?php the_permalink(); ?&gt;\"&gt;&lt;span class=\"post-date\"&gt;&lt;?php the_time('Y.m.d'); ?&gt;&lt;\/span&gt;&lt;span class=\"post-list-title\"&gt;&lt;?php the_title(); ?&gt;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n\n    &lt;?php endwhile; ?&gt;\n    &lt;?php else : ?&gt;\n      &lt;li&gt;&lt;p&gt;\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002&lt;\/p&gt;&lt;\/li&gt;\n    &lt;?php endif; ?&gt;\n     &lt;\/ul&gt;\n     &lt;?php wp_pagenavi(array('query' =&gt; $my_query)); ?&gt; \/\/\u30b5\u30d6\u30eb\u30fc\u30d7\u3092\u5f15\u6570\u3067\u6e21\u3059\n      &lt;?php wp_reset_postdata(); ?&gt;<\/pre>\n<p>\u3053\u308c\u3067\u6050\u3089\u304f\u3061\u3083\u3093\u3068\u52d5\u304f\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u4ed6\u306b\u3046\u307e\u304f\u52d5\u304b\u306a\u3044\u30b1\u30fc\u30b9\u3068\u3057\u3066\u306f\u3001\u56fa\u5b9a\u30da\u30fc\u30b8\u306b\u30eb\u30fc\u30d7\u3092\u8a18\u8ff0\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u3001<br \/>\n\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u540d\u3068\u3001\u56fa\u5b9a\u30da\u30fc\u30b8\u306e\u30b9\u30e9\u30c3\u30b0\u304c\u540c\u3058\u3060\u3068\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u56fa\u5b9a\u30d5\u30ed\u30f3\u30c8\u30da\u30fc\u30b8\u306e\u5834\u5408\u306b\u3082\u3001\u30da\u30fc\u30b8\u6570\u53d6\u5f97\u7b87\u6240\u306e\u8a18\u8ff0\u306b\u9055\u3044\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" >$paged = get_query_var('page'); \/\/\u56fa\u5b9a\u30d5\u30ed\u30f3\u30c8\u30da\u30fc\u30b8\u3067\u30da\u30fc\u30b8\u6570\u3092\u53d6\u5f97<\/pre>\n<p>\u3053\u3053\u307e\u3067\u78ba\u8a8d\u3059\u308c\u3070\u5927\u62b5\u306e\u74b0\u5883\u3067\u52d5\u4f5c\u3059\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306fWP\u306e\u6295\u7a3f\u306b\u7c21\u5358\u306b\u30da\u30fc\u30b8\u9001\u308a\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3067\u304d\u308b\u30d7\u30e9\u30b0\u30a4\u30f3 \u300cWP-PageNavi\u300d\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u307e\u305a\u306f\u4e0b\u8a18\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3057\u3087\u3046\u3002\u516c\u5f0f\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\u306e\u3067\u3001\u7ba1\u7406\u753b\u9762\u304b\u3089\u3082\u8ffd\u52a0\u53ef\u80fd\u3067\u3059\u3002 https:\/\/ja [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":612,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"","_original_post":"","footnotes":""},"categories":[1],"tags":[],"publishpress_future_action":{"enabled":false,"date":"2026-04-11 18:24:12","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1410"}],"collection":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/comments?post=1410"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1410\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media\/612"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=1410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=1410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=1410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}