{"id":3269,"date":"2020-04-21T17:11:30","date_gmt":"2020-04-21T08:11:30","guid":{"rendered":"https:\/\/okamurax.com\/?p=3269"},"modified":"2021-07-31T20:52:03","modified_gmt":"2021-07-31T11:52:03","slug":"wordpress-%e5%85%a8%e8%a8%98%e4%ba%8b%e4%b8%80%e8%a6%a7","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=3269","title":{"rendered":"WordPress \u8a18\u4e8b\u4e00\u89a7\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u691c\u7d22"},"content":{"rendered":"<p>wp-content\/themes\/xxx<br \/>\n\u306e\u4e2d\u306b\u9069\u5f53\u306a\u540d\u524d(\u3053\u3053\u3067\u306fpage2.php)\u3092\u4ed8\u3051\u4e0b\u8a18\u3092\u8cbc\u4ed8\u3051\u3002<br \/>\n\u56fa\u5b9a\u30da\u30fc\u30b8\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089TEST\u3092\u9078\u629e\u3002<\/p>\n<pre class=\"lang:php decode:true \">&lt;?php\r\n\r\nfunction footer_article_search(){\r\n\r\necho &lt;&lt;&lt;HTML\r\n  &lt;script&gt;\r\n  jQuery(window).on('load', function() {\r\n    jQuery(\"#pattern\").val('');\r\n    let raw_titles = jQuery(\"#titles\").children();\r\n    jQuery(\"#pattern\").on(\"keyup\",function(){\r\n      jQuery(\"#titles\").empty();\r\n      let pattern = jQuery(\"#pattern\").val();\r\n      if (pattern == \"\") {\r\n        jQuery(\"#titles\").append(raw_titles);\r\n      } else {\r\n        raw_titles.each(function(){\r\n          let target = jQuery(this).text();\r\n          if (target.toLowerCase().indexOf(pattern) != -1) {\r\n            jQuery(\"#titles\").append(jQuery(this));\r\n          }\r\n        });\r\n      }\r\n    });\r\n  });\r\n  &lt;\/script&gt;\r\nHTML;\r\n}\r\n\r\nfunction header_article_search(){\r\n\r\necho &lt;&lt;&lt;HTML\r\n  &lt;style&gt;\r\n\r\n  li{\r\n    list-style: none;\r\n  }\r\n\r\n  .tag, .tag a{\r\n    color: grey;\r\n    font-size: 0.9em;\r\n  }\r\n\r\n  #pattern {\r\n    font-size: 16px;\r\n    width: 300px;\r\n  }\r\n\r\n  #search input[type=\"submit\"] {\r\n    display: none;\r\n  }\r\n\r\n  &lt;\/style&gt;\r\nHTML;\r\n}\r\n\r\nadd_action( 'wp_head', 'header_article_search', 1);\r\nadd_action( 'wp_footer', 'footer_article_search', 1);\r\n\r\n\/* Template Name: TEST *\/\r\n\r\nget_header();\r\n\r\n?&gt;\r\n\r\n&lt;div class=\"wrap\"&gt;\r\n&lt;div id=\"primary\" class=\"content-area\"&gt;\r\n&lt;main id=\"main\" class=\"site-main\" role=\"main\"&gt;\r\n\r\n&lt;?php\r\nif (strpos(get_pagenum_link(), \"checked\")){\r\n  echo '&lt;a href=\"' . $post-&gt;guid . '\"&gt;\u6295\u7a3f\u65e5\u9806&lt;\/a&gt;\u3000';\r\n  echo '[\u30bf\u30a4\u30c8\u30eb\u9806]';\r\n} else {\r\n  echo '[\u6295\u7a3f\u65e5\u9806]\u3000';\r\n  echo '&lt;a href=\"' . $post-&gt;guid . '&amp;checked\"&gt;\u30bf\u30a4\u30c8\u30eb\u9806&lt;\/a&gt;';\r\n}\r\n?&gt;\r\n\r\n&lt;form action=\"https:\/\/www.google.com\/search\" target=\"_blank\" id=\"search\"&gt;\r\n  &lt;input type=\"text\" id=\"pattern\" name=\"q\" placeholder=\"\u30ea\u30b9\u30c8\u691c\u7d22 \/ \u30b5\u30a4\u30c8\u5185\u691c\u7d22\"\/&gt;\r\n  &lt;input type=\"hidden\" name=\"hl\" value=\"ja\" \/&gt;\r\n  &lt;input type=\"hidden\" value=\"https:\/\/appbay.org\/\" name=\"as_sitesearch\" \/&gt;\r\n  &lt;input type=\"submit\" name=\"btnG\" value=\"\" \/&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;?php\r\n\r\nif (strpos(get_pagenum_link(), \"checked\")){\r\n  $args = array(\r\n    'posts_per_page' =&gt; -1,\r\n    'post_type' =&gt; 'post',\r\n    'orderby' =&gt; 'title',\r\n    'order'   =&gt; 'asc',\r\n  );\r\n} else {\r\n  $args = array(\r\n    'posts_per_page' =&gt; -1,\r\n    'post_type' =&gt; 'post',\r\n  );\r\n}\r\n\r\n$myposts = get_posts( $args );\r\n\r\necho \"&lt;ul id=titles&gt;\";\r\nforeach ($myposts as $post) : setup_postdata($post);\r\n  echo \"&lt;li&gt;\";\r\n  echo \"&lt;a target='_blank' href='\";\r\n  the_permalink();\r\n  echo \"'&gt;\";\r\n  the_time('Y-m-d');\r\n  echo \"\u3000\";\r\n  the_title();\r\n  echo \"&lt;\/a&gt;\";\r\n  echo \"\u3000\";\r\n  echo \"&lt;span class='tag'&gt;\";\r\n  the_tags(\"\");\r\n  echo \"&lt;\/span&gt;\";\r\necho \"&lt;\/li&gt;\";\r\nendforeach; \r\necho \"&lt;\/ul&gt;\";\r\n\r\nwp_reset_postdata();\r\necho get_the_content();\r\necho \"&lt;\/main&gt;&lt;\/div&gt;&lt;\/div&gt;\";\r\nget_footer();<\/pre>\n<p>\u3053\u308c\u3067\u3001Enter\u3092\u62bc\u305b\u3070Google\u306e\u30b5\u30a4\u30c8\u5185\u691c\u7d22\u304c\u5b9f\u884c\u3055\u308c\u3001\u6587\u5b57\u3092\u5165\u529b\u3059\u308b\u3060\u3051\u306a\u3089\u30ea\u30b9\u30c8\u691c\u7d22(\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u30b5\u30fc\u30c1)\u304c\u5b9f\u884c\u3055\u308c\u308b\u3002<\/p>\n<p>\u30d6\u30ed\u30b0\u3092\u30e1\u30e2\u4ee3\u308f\u308a\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u904e\u53bb\u306e\u8a18\u4e8b\u3092\u63a2\u3059\u3053\u3068\u3082\u591a\u3044\u3002\u4eca\u307e\u3067\u306fGoogle\u306e\u30b5\u30a4\u30c8\u5185\u691c\u7d22\u3060\u3051\u3060\u3063\u305f\u304c\u3001\u30bf\u30a4\u30c8\u30eb\u3060\u3051\u691c\u7d22\u3067\u304d\u308c\u3070\u5341\u5206\u3068\u3044\u3046\u5834\u5408\u3082\u591a\u3044\u306e\u3067\u3053\u3061\u3089\u306e\u307b\u3046\u304c\u4fbf\u5229\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"nrSmMl26Me\"><p><a href=\"https:\/\/appbay.org\/?page_id=3265\">\u8a18\u4e8b\u4e00\u89a7<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;\u8a18\u4e8b\u4e00\u89a7&#8221; &#8212; \u30c6\u30c3\u30af\u30e1\u30e2\" src=\"https:\/\/appbay.org\/?page_id=3265&#038;embed=true#?secret=Z1NtbSq0kX#?secret=nrSmMl26Me\" data-secret=\"nrSmMl26Me\" width=\"525\" height=\"296\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>wp-content\/themes\/xxx \u306e\u4e2d\u306b\u9069\u5f53\u306a\u540d\u524d(\u3053\u3053\u3067\u306fpage2.php)\u3092\u4ed8\u3051\u4e0b\u8a18\u3092\u8cbc\u4ed8\u3051\u3002 \u56fa\u5b9a\u30da\u30fc\u30b8\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089TEST\u3092\u9078\u629e\u3002 &lt;?php function footer_articl &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=3269\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;WordPress \u8a18\u4e8b\u4e00\u89a7\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u691c\u7d22&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[85],"class_list":["post-3269","post","type-post","status-publish","format-standard","hentry","category-1","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3269"}],"version-history":[{"count":25,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3269\/revisions"}],"predecessor-version":[{"id":4463,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3269\/revisions\/4463"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}