{"id":1650,"date":"2019-02-12T19:23:09","date_gmt":"2019-02-12T10:23:09","guid":{"rendered":"http:\/\/4koma-web.com\/coding\/?p=1650"},"modified":"2019-02-13T17:05:50","modified_gmt":"2019-02-13T08:05:50","slug":"%e6%8a%95%e7%a8%bf%e8%a8%98%e4%ba%8b%e3%81%ab%e9%80%a3%e7%95%aa%e3%82%92%e6%8c%af%e3%82%8b","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/%e6%8a%95%e7%a8%bf%e8%a8%98%e4%ba%8b%e3%81%ab%e9%80%a3%e7%95%aa%e3%82%92%e6%8c%af%e3%82%8b\/","title":{"rendered":"\u6295\u7a3f\u8a18\u4e8b\u306b\u9023\u756a\u3092\u632f\u308b"},"content":{"rendered":"<p>\u6295\u7a3f\u8a18\u4e8b\u306b\u9023\u756a\u3092\u632f\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u4f7f\u3044\u65b9\u306e\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u3001\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306e\u65b0\u7740\u8a18\u4e8b\u304b\u3089\u65b0\u7740\u4e00\u89a7\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8\u306e\u7279\u5b9a\u306e\u8a18\u4e8b\u306b\u3001<br \/>\n\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3068\u3057\u3066\u98db\u3070\u3059\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u6307\u5b9a\u3057\u305f\u6295\u7a3f\u30bf\u30a4\u30d7\u306b\u9023\u756a\u3092\u632f\u308b\u3088\u3046function.php\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002\uff08\u3053\u3053\u3067\u306f&#8217;\u30ec\u30d3\u30e5\u30fc=review&#8217;\u3068\u3057\u3066\u3044\u307e\u3059\u3002\uff09<br \/>\n\u25a0function.php<\/p>\n<pre>\r\nfunction get_post_number( $post_type = 'review', $op = '>' ) {\r\n    global $wpdb, $post;\r\n    $post_type = is_array($post_type) ? implode(\"','\", $post_type) : $post_type;\r\n    $number = $wpdb->get_var(\"\r\n        SELECT COUNT( * ) + 1\r\n        FROM $wpdb->posts\r\n        WHERE post_date {$op} '{$post->post_date}'\r\n        AND post_status = 'publish'\r\n        AND post_type = ('{$post_type}')\r\n    \");\r\n    return $number;\r\n}\r\n<\/pre>\n<p>\u5148\u307b\u3069\u306e\u6295\u7a3f\u3055\u308c\u305f\u8a18\u4e8b\u306b\u9023\u756a\u3092\u632f\u308a<\/p>\n<pre><?php the_ID(); ?><\/pre>\n<p>\u3067\u8a18\u4e8bID\u3092\u6307\u5b9a\u3057\u3066\u3084\u308b\u3053\u3068\u3067\u3001<br \/>\n\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u4f55\u30da\u30fc\u30b8\u76ee\u306e\u25cb\u25cb\u306e\u8a18\u4e8b\u306b\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3055\u305b\u308b\u3068\u3044\u3063\u305f\u3053\u3068\u3082\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u306e\u8a18\u8ff0\u306f\u30c8\u30c3\u30d7\u306e\u65b0\u7740\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u30eb\u30fc\u30d7\u5206\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\n<?php if (get_post_type() === 'review'): ?>\r\n  <?php\r\n\t$no = get_post_number( $post->post_type );\r\n\t$i = 10;\r\n\tfor ($b = 1;; $b++) {\r\n\tif ($no <= $i * $b) {\r\n\tbreak;\r\n\t}\r\n\t}\r\n  ?>\t\r\n    <a href=\"<?php echo esc_url( home_url( '\/' ) ); ?>review\/page\/<?php echo $b?>\/#<?php the_ID(); ?>\">\r\n    <?php else : ?>\r\n   <a href=\"<?php the_permalink(); ?>\">\r\n<?php endif; ?>\r\n<\/pre>\n<p>\u4e0a\u8a18\u3067\u306f\u3001\u30a2\u30fc\u30ab\u30a4\u30d6\u306e1\u30da\u30fc\u30b8\u306b10\u8a18\u4e8b\u8868\u793a\u3055\u308c\u308b\u3068\u3057\u3066\u3001\u8a72\u5f53\u3059\u308b\u8a18\u4e8b\u304c\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8\u306e\u4f55\u30da\u30fc\u30b8\u76ee\u306b\u3042\u308b\u304b\u3092\u5224\u5b9a\u3057\u3066\u3001<br \/>\n\u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3092\u98db\u3070\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b)\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u3001review\u306b\u5c5e\u3059\u308b\u7279\u5b9a\u306e\u8a18\u4e8b\u304c15\u756a\u76ee\u306e\u8a18\u4e8b\u3067ID\u304c26\u3060\u3063\u305f\u3068\u3057\u3066$i(\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8\u3001\uff11\u30da\u30fc\u30b8\u306e\u8a18\u4e8b\u6570)\u304b\u30892\u56de\u76ee\u306e\u30eb\u30fc\u30d7\u300110\u4ee5\u4e0a20\u4ee5\u5185\u306e\uff082\u30da\u30fc\u30b8\u76ee\uff09\u306b\u3042\u308b\u306e\u3067\u3001<\/p>\n<pre>\r\n<a href=\"<?php echo esc_url( home_url( '\/' ) ); ?>review\/page\/2\/#26\">\r\n<\/pre>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6295\u7a3f\u8a18\u4e8b\u306b\u9023\u756a\u3092\u632f\u308b\u65b9\u6cd5\u3067\u3059\u3002 \u4f7f\u3044\u65b9\u306e\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u3001\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306e\u65b0\u7740\u8a18\u4e8b\u304b\u3089\u65b0\u7740\u4e00\u89a7\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8\u306e\u7279\u5b9a\u306e\u8a18\u4e8b\u306b\u3001 \u30a2\u30f3\u30ab\u30fc\u30ea\u30f3\u30af\u3068\u3057\u3066\u98db\u3070\u3059\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 \u307e\u305a\u306f\u3001\u6307\u5b9a\u3057\u305f\u6295\u7a3f\u30bf\u30a4\u30d7\u306b\u9023\u756a\u3092\u632f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"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 19:56:42","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1650"}],"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=1650"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1650\/revisions"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=1650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=1650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=1650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}