{"id":303,"date":"2026-03-27T23:36:40","date_gmt":"2026-03-27T14:36:40","guid":{"rendered":"https:\/\/tool-laboratory.com\/?p=303"},"modified":"2026-03-27T23:36:42","modified_gmt":"2026-03-27T14:36:42","slug":"popular-posts-tool","status":"publish","type":"post","link":"https:\/\/tool-laboratory.com\/en\/popular-posts-tool\/","title":{"rendered":"\u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\u30c4\u30fc\u30eb\uff5c\u30ab\u30c6\u30b4\u30ea\u5225\u3067\u4eba\u6c17\u9806\u8868\u793a\u3010WordPress\u5bfe\u5fdc\u3011"},"content":{"rendered":"\n<div class=\"tool-card\">\n  <h2>\u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0<\/h2>\n\n  <div class=\"form-group\">\n    <label>\u30ab\u30c6\u30b4\u30ea\u3092\u9078\u629e<\/label>\n    <select id=\"categorySelect\">\n      <option value=\"money-tools\">money-tools<\/option>\n      <option value=\"house-tools\">house-tools<\/option>\n      <option value=\"change-tools\">change-tools<\/option>\n      <option value=\"it-tools\" selected>it-tools<\/option>\n      <option value=\"calculator\">calculator<\/option>\n    <\/select>\n  <\/div>\n\n  <div class=\"form-group\">\n    <label>\u691c\u7d22<\/label>\n    <input type=\"text\" id=\"searchInput\" placeholder=\"\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\">\n  <\/div>\n\n  <div class=\"form-group\">\n    <label>\u4e26\u3073\u66ff\u3048<\/label>\n    <select id=\"sortSelect\">\n      <option value=\"popular\">\u4eba\u6c17\u9806<\/option>\n      <option value=\"new\">\u65b0\u7740\u9806<\/option>\n    <\/select>\n  <\/div>\n\n  <button id=\"loadBtn\">\u8868\u793a<\/button>\n\n  <div id=\"result\"><\/div>\n<\/div>\n\n<style>\n.tool-card {\n  max-width: 600px;\n  margin: 20px auto;\n  padding: 20px;\n  border-radius: 12px;\n  background: #fff;\n  box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n}\n.form-group {\n  margin-bottom: 15px;\n}\ninput, select, button {\n  width: 100%;\n  padding: 12px;\n  border-radius: 8px;\n  border: 1px solid #ddd;\n}\nbutton {\n  background: #0073aa;\n  color: #fff;\n  border: none;\n  font-weight: bold;\n}\n.post-item {\n  padding: 12px;\n  border-bottom: 1px solid #eee;\n}\n.post-item a {\n  text-decoration: none;\n  color: #333;\n  font-weight: bold;\n}\n.error {\n  color: red;\n  padding: 10px;\n}\n<\/style>\n\n<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n  const btn = document.getElementById(\"loadBtn\");\n  const result = document.getElementById(\"result\");\n\n  btn.addEventListener(\"click\", function () {\n\n    const slug = document.getElementById(\"categorySelect\").value;\n    const keyword = document.getElementById(\"searchInput\").value.toLowerCase();\n    const sort = document.getElementById(\"sortSelect\").value;\n\n    result.innerHTML = \"\u8aad\u307f\u8fbc\u307f\u4e2d...\";\n\n    fetch(\"\/wp-json\/wp\/v2\/categories?slug=\" + slug)\n      .then(res => res.json())\n      .then(catData => {\n\n        if (!catData.length) {\n          throw new Error(\"\u30ab\u30c6\u30b4\u30ea\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\");\n        }\n\n        const catId = catData[0].id;\n\n        return fetch(\"\/wp-json\/wp\/v2\/posts?categories=\" + catId + \"&per_page=20\");\n      })\n      .then(res => res.json())\n      .then(posts => {\n\n        if (!posts.length) {\n          result.innerHTML = \"\u8a18\u4e8b\u304c\u3042\u308a\u307e\u305b\u3093\";\n          return;\n        }\n\n        let filtered = posts.filter(post =>\n          post.title.rendered.toLowerCase().includes(keyword)\n        );\n\n        \/\/ \u7591\u4f3c\u4eba\u6c17\u9806\uff08ID\u964d\u9806\uff09\n        if (sort === \"popular\") {\n          filtered.sort((a, b) => b.id - a.id);\n        } else {\n          filtered.sort((a, b) => new Date(b.date) - new Date(a.date));\n        }\n\n        let html = \"\";\n\n        filtered.forEach(post => {\n          html += `\n            <div class=\"post-item\">\n              <a href=\"${post.link}\">${post.title.rendered}<\/a>\n            <\/div>\n          `;\n        });\n\n        result.innerHTML = html || \"\u8a72\u5f53\u8a18\u4e8b\u306a\u3057\";\n      })\n      .catch(err => {\n        result.innerHTML = '<div class=\"error\">\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f<\/div>';\n        console.error(err);\n      });\n\n  });\n\n});\n<\/script>\n\n\n\n<p>\u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\u30c4\u30fc\u30eb\u306f\u3001\u30ab\u30c6\u30b4\u30ea\u3054\u3068\u306e\u8a18\u4e8b\u3092\u4e00\u89a7\u8868\u793a\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u300c\u4eca\u3088\u304f\u8aad\u307e\u308c\u3066\u3044\u308b\u8a18\u4e8b\u300d\u3092\u7d20\u65e9\u304f\u898b\u3064\u3051\u3089\u308c\u308b\u4fbf\u5229\u306a\u6a5f\u80fd\u3067\u3059\u3002\u7279\u306b\u30c4\u30fc\u30eb\u7cfb\u30b5\u30a4\u30c8\u3067\u306f\u8a18\u4e8b\u6570\u304c\u5897\u3048\u308b\u307b\u3069\u30e6\u30fc\u30b6\u30fc\u304c\u8ff7\u3044\u3084\u3059\u304f\u306a\u308b\u305f\u3081\u3001\u4eba\u6c17\u9806\u3084\u691c\u7d22\u6a5f\u80fd\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u304c\u91cd\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30c4\u30fc\u30eb\u3067\u306f\u3001WordPress\u306eREST API\u3092\u6d3b\u7528\u3057\u3001\u6307\u5b9a\u3057\u305f\u30ab\u30c6\u30b4\u30ea\u306e\u6295\u7a3f\u3092\u81ea\u52d5\u53d6\u5f97\u3057\u307e\u3059\u3002\u30ab\u30c6\u30b4\u30ea\u306f\u30b9\u30e9\u30c3\u30b0\u3067\u6307\u5b9a\u3067\u304d\u308b\u305f\u3081\u3001money-tools\u3084calculator\u306a\u3069\u65e2\u5b58\u69cb\u6210\u306b\u305d\u306e\u307e\u307e\u5bfe\u5fdc\u53ef\u80fd\u3067\u3059\u3002\u307e\u305f\u3001JavaScript\u306efetch\u3092\u4f7f\u7528\u3057\u3066\u975e\u540c\u671f\u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u3092\u884c\u3046\u305f\u3081\u3001\u30da\u30fc\u30b8\u9077\u79fb\u306a\u3057\u3067\u30b9\u30e0\u30fc\u30ba\u306b\u8a18\u4e8b\u4e00\u89a7\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3055\u3089\u306b\u3001\u691c\u7d22\u6a5f\u80fd\u3092\u642d\u8f09\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3059\u308b\u3060\u3051\u3067\u76ee\u7684\u306e\u8a18\u4e8b\u3092\u7d5e\u308a\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u56de\u904a\u7387\u304c\u5927\u304d\u304f\u5411\u4e0a\u3057\u3001\u76f4\u5e30\u7387\u306e\u6539\u5584\u306b\u3082\u3064\u306a\u304c\u308a\u307e\u3059\u3002\u4e26\u3073\u66ff\u3048\u6a5f\u80fd\u3067\u306f\u300c\u4eba\u6c17\u9806\u300d\u3068\u300c\u65b0\u7740\u9806\u300d\u3092\u9078\u629e\u3067\u304d\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30cb\u30fc\u30ba\u306b\u5fdc\u3058\u305f\u95b2\u89a7\u4f53\u9a13\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u73fe\u72b6\u306e\u4eba\u6c17\u9806\u306f\u7591\u4f3c\u7684\u306bID\u30d9\u30fc\u30b9\u3067\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5c06\u6765\u7684\u306b\u306fPV\u30ab\u30a6\u30f3\u30c8\u3092\u7528\u3044\u305f\u672c\u683c\u7684\u306a\u30e9\u30f3\u30ad\u30f3\u30b0\u3078\u62e1\u5f35\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u7cbe\u5ea6\u306e\u9ad8\u3044\u30b3\u30f3\u30c6\u30f3\u30c4\u8a98\u5c0e\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001functions.php\u3067\u95b2\u89a7\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3053\u3068\u3067\u3001\u5b9f\u969b\u306e\u4eba\u6c17\u9806\u3092\u53cd\u6620\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>UI\u306f\u30b9\u30de\u30db\u6700\u9069\u5316\u3092\u91cd\u8996\u3057\u3001\u30ab\u30fc\u30c9\u30c7\u30b6\u30a4\u30f3\u30fb\u5927\u304d\u3081\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u30fb\u30bf\u30c3\u30d7\u3057\u3084\u3059\u3044\u30dc\u30bf\u30f3\u8a2d\u8a08\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u30e2\u30d0\u30a4\u30eb\u30e6\u30fc\u30b6\u30fc\u3067\u3082\u30b9\u30c8\u30ec\u30b9\u306a\u304f\u64cd\u4f5c\u3067\u304d\u3001\u96e2\u8131\u3092\u9632\u3050\u52b9\u679c\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u691c\u7d22\uff0b\u30e9\u30f3\u30ad\u30f3\u30b0\u306e\u7d44\u307f\u5408\u308f\u305b\u306f\u30e6\u30fc\u30b6\u30fc\u884c\u52d5\u3092\u4fc3\u9032\u3057\u3084\u3059\u304f\u3001\u53ce\u76ca\u5316\u3068\u306e\u76f8\u6027\u3082\u975e\u5e38\u306b\u826f\u3044\u69cb\u6210\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u5185\u90e8\u30ea\u30f3\u30af\u5c0e\u7dda\u3068\u3057\u3066\u3082\u975e\u5e38\u306b\u512a\u79c0\u3067\u3001\u95a2\u9023\u8a18\u4e8b\u3084\u4eba\u6c17\u8a18\u4e8b\u3092\u81ea\u52d5\u8868\u793a\u3059\u308b\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u8907\u6570\u30da\u30fc\u30b8\u3092\u56de\u904a\u3059\u308b\u6d41\u308c\u3092\u81ea\u7136\u306b\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7d50\u679c\u3068\u3057\u3066\u30da\u30fc\u30b8\u30d3\u30e5\u30fc\u306e\u5897\u52a0\u3001\u6ede\u5728\u6642\u9593\u306e\u5ef6\u9577\u3001AdSense\u53ce\u76ca\u306e\u6700\u5927\u5316\u306b\u3064\u306a\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c4\u30fc\u30eb\u7cfb\u30b5\u30a4\u30c8\u3067\u691c\u7d22\u4e0a\u4f4d\u3092\u72d9\u3046\u5834\u5408\u3001\u5358\u4f53\u6a5f\u80fd\u3060\u3051\u3067\u306a\u304f\u300c\u4f7f\u3044\u3084\u3059\u3055\u300d\u300c\u63a2\u3057\u3084\u3059\u3055\u300d\u304c\u91cd\u8981\u3067\u3059\u3002\u3053\u306e\u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3067\u3001\u30b5\u30a4\u30c8\u5168\u4f53\u306eUX\u3092\u5e95\u4e0a\u3052\u3057\u3001SEO\u8a55\u4fa1\u306e\u5411\u4e0a\u306b\u3082\u8ca2\u732e\u3057\u307e\u3059\u3002<audio autoplay=\"\"><\/audio><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0 \u30ab\u30c6\u30b4\u30ea\u3092\u9078\u629e money-toolshouse-toolschange-toolsit-toolscalculator \u691c\u7d22 \u4e26\u3073\u66ff\u3048 \u4eba\u6c17\u9806\u65b0\u7740\u9806 \u8868\u793a \u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\u30c4\u30fc\u30eb\u306f\u3001\u30ab\u30c6\u30b4\u30ea\u3054\u3068\u306e &#8230; <a title=\"\u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\u30c4\u30fc\u30eb\uff5c\u30ab\u30c6\u30b4\u30ea\u5225\u3067\u4eba\u6c17\u9806\u8868\u793a\u3010WordPress\u5bfe\u5fdc\u3011\" class=\"read-more\" href=\"https:\/\/tool-laboratory.com\/en\/popular-posts-tool\/\" aria-label=\"Read more about \u4eba\u6c17\u8a18\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\u30c4\u30fc\u30eb\uff5c\u30ab\u30c6\u30b4\u30ea\u5225\u3067\u4eba\u6c17\u9806\u8868\u793a\u3010WordPress\u5bfe\u5fdc\u3011\">Read more<\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-303","post","type-post","status-publish","format-standard","hentry","category-it-tools"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/posts\/303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/comments?post=303"}],"version-history":[{"count":1,"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/posts\/303\/revisions"}],"predecessor-version":[{"id":305,"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/posts\/303\/revisions\/305"}],"wp:attachment":[{"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/media?parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/categories?post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tool-laboratory.com\/en\/wp-json\/wp\/v2\/tags?post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}