{"id":1596,"date":"2015-10-23T17:18:36","date_gmt":"2015-10-23T08:18:36","guid":{"rendered":"http:\/\/agn.jp\/blog\/?p=1596"},"modified":"2015-10-23T17:18:36","modified_gmt":"2015-10-23T08:18:36","slug":"wordpress%e3%81%ab%e4%be%bf%e5%88%a9%e3%81%aa%e3%82%bd%e3%83%bc%e3%82%b9%e3%80%82","status":"publish","type":"post","link":"http:\/\/agn.jp\/blog\/?p=1596","title":{"rendered":"WordPress\u306b\u4fbf\u5229\u306a\u30bd\u30fc\u30b9\u3002"},"content":{"rendered":"<p>\u79c1\u304cWordPress\u3067\u69cb\u7bc9\u3059\u308b\u969b\u306b\u8ffd\u52a0\u3057\u3066\u3044\u308b<br \/>\n\u4fbf\u5229\u306a\u30bd\u30fc\u30b9\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<div style=\"text-align: center;border-top: 6px solid #00529f;border-bottom: 6px solid #00529f;padding:5px 0;\">\n<strong>funtions.php\u306b\u8a18\u8ff0\u3059\u308b\u4fbf\u5229\u306a\u30bd\u30fc\u30b9<\/strong>\n<\/div>\n<p><strong>\u3010\u56fa\u5b9a\u30da\u30fc\u30b8\u5185\u306e\u753b\u50cfURL\u3092\u7c21\u5358\u306b\u3059\u308b\u3011<\/strong><br \/>\n\u56fa\u5b9a\u30da\u30fc\u30b8\u5185\u3067\u753b\u50cf\u3092\u4f7f\u3046\u969b\u306b\u300eget_bloginfo(&#8216;template_directory&#8217;)\u300f\u3092\u30a4\u30c1\u30a4\u30c1\u4ed8\u3051\u308b\u306e\u306f\u9762\u5012\u306a\u306e\u3067<br \/>\n\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u300eimage\/\u300f\u304c\u4ed8\u3044\u305f\u3089\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u307e\u3067\u306eURL\u3092\u4ed8\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\nfunction replaceImagePath($arg) {\r\n\t$content = str_replace('\"images\/', '\"' . get_bloginfo('template_directory') . '\/images\/', $arg);\r\n\treturn $content;\r\n}  \r\nadd_action('the_content', 'replaceImagePath');\r\n<\/pre>\n<p><strong>\u3010\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u4e00\u89a7\u3067\u30ab\u30c6\u30b4\u30ea\u3067\u3082\u7d5e\u308a\u8fbc\u307f\u3057\u305f\u3044\u3011<\/strong><br \/>\n\u6295\u7a3f\u4e00\u89a7\u3067\u306f\u30ab\u30c6\u30b4\u30ea\u3067\u306e\u7d5e\u308a\u8fbc\u307f\u306f\u3067\u304d\u307e\u3059\u304c<br \/>\n\u3069\u3046\u8a00\u3046\u8a33\u304b\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u3067\u306f\u7d5e\u308a\u8fbc\u307f\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u3082\u3063\u3068\u3082\u8a2d\u5b9a\u81ea\u4f53\u304c\u30e6\u30fc\u30b6\u30fc\u6b21\u7b2c\u306a\u306e\u3067\u4ed8\u3051\u3088\u3046\u304c\u306a\u3044\u3068\u306f\u601d\u3044\u307e\u3059\u304c<br \/>\n\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u3067\u3082\u6295\u7a3f\u6570\u304c\u5897\u3048\u308b\u3068\u5fc5\u8981\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002<br \/>\n\u30b5\u30f3\u30d7\u30eb\u3067\u306f<br \/>\n\u300a\u3000\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u540d:list\u3000\uff0f\u3000\u5206\u985e\u540d\uff1acate\u3000\u300b<br \/>\n\u3067\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>\r\nadd_action( 'restrict_manage_posts', 'add_post_taxonomy_restrict_filter' );\r\nfunction add_post_taxonomy_restrict_filter() {\r\n    global $post_type;\r\n    if ( 'list\u3014\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u540d\u3015' == $post_type ) {\r\n        ?>\r\n        <select name=\"cate\u3014\u5206\u985e\u540d\u3015\">\r\n            <option value=\"\">\u30ab\u30c6\u30b4\u30ea\u30fc\u6307\u5b9a\u306a\u3057<\/option>\r\n            <?php\r\n            $terms = get_terms('cate\u3014\u5206\u985e\u540d\u3015');\r\n            foreach ($terms as $term) { ?>\r\n                <option value=\"<?php echo $term->slug; ?>\"><?php echo $term->name; ?><\/option>\r\n            <?php } ?>\r\n        <\/select>\r\n        <?php\r\n    }\r\n}\r\n<\/pre>\n<p><strong>\u3010\u56fa\u5b9a\u30da\u30fc\u30b8\u5185\u3067PHP\u3092\u4f7f\u3044\u305f\u3044\u21d2\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u5bfe\u5fdc\u3011<\/strong><br \/>\n\u4eca\u66f4\u306a\u3093\u3067\u3059\u304c\u3001\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u8a18\u8ff0\u304c\u7406\u89e3\u3057\u304d\u308c\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u2026<br \/>\n\u57fa\u672c\u7684\u306a\u90e8\u5206\u306f\u5206\u304b\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u2026\u96e3\u3057\u304f\u8003\u3048\u3059\u304e\u3066\u3044\u305f\u3088\u3046\u3067\u3059\u3002<br \/>\n\u305d\u3093\u306a\u540c\u985e\u306e\u65b9\u306b\u5411\u3051\u3066\u3001\u4e00\u756a\u5206\u304b\u308a\u3084\u3059\u3044\u7269\u3092\u2026<\/p>\n<pre>\r\nfunction indexft() {\r\n    return \"<a href='\" . get_bloginfo('url') . \"'>\u30c8\u30c3\u30d7<\/a>\";\r\n}\r\nadd_shortcode('idxfc\u3014\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3015', 'indexft\u3014\u95a2\u6570\u540d\u3015');\r\n<\/pre>\n<p>\u300aindexft()\u300b\u304c\u95a2\u6570\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\"return\"\u5185\u3067\u8fd4\u3059\u5185\u5bb9\u3092\u7528\u610f\u3002\u4eca\u56de\u306f\u3001\u30c8\u30c3\u30d7\u3078\u623b\u308b\u30ea\u30f3\u30af\u300e\u30c8\u30c3\u30d7\u300f\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u56fa\u5b9a\u30da\u30fc\u30b8\u3001\u307e\u305f\u306f\u6295\u7a3f\u30da\u30fc\u30b8\u306b\u300a[idxfc]\u300b\u3068\u8a00\u3046\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u304c\u3042\u3063\u305f\u3089\u3001\u30bd\u30b3\u306b\u300e\u30c8\u30c3\u30d7\u300f\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div style=\"text-align: center;border-top: 6px solid #00529f;border-bottom: 6px solid #00529f;padding:5px 0;\">\n<strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8PHP\u306b\u8a18\u8ff0\u3059\u308b\u4fbf\u5229\u306a\u30bd\u30fc\u30b9<\/strong>\n<\/div>\n<p><strong>\u3010\u4e00\u5b9a\u65e5\u6570\u5185\u306e\u8a18\u4e8b\u306b\u201dNEW\u201d\u3092\u4ed8\u3051\u305f\u3044\u3011<\/strong><br \/>\n\u30da\u30fc\u30b8\u5185\u3067\u65b0\u7740\u60c5\u5831\u306a\u3069\u306e\u4e00\u89a7\u8868\u793a\u90e8\u5206\u3067\u4e00\u5b9a\u306e\u671f\u9593\u3060\u3051\"NEW\"\u30de\u30fc\u30af\u3092\u4ed8\u3051\u305f\u3044\u3002<br \/>\n\u30de\u30fc\u30af\u3092\u4ed8\u3051\u305f\u3044\u90e8\u5206\u306b\u4e0b\u8a18\u306e\u30bd\u30fc\u30b9\u3092\u539f\u3060\u3051\u3067OK\u3002<br \/>\n\u300eecho\u300f\u3067\u5410\u304d\u51fa\u3057\u307e\u3059\u306e\u3067\u3001\u753b\u50cf\u3067\u3082\u30bf\u30b0\u4ed8\u3067\u3082<\/p>\n<pre>\r\n<?php\r\n$days = 7; \/\/\u8868\u793a\u3059\u308b\u65e5\u6570\u3002\u3053\u308c\u306f\u516c\u958b\u65e5\u304b\u30897\u65e5\u3002\r\n$today = date_i18n('U');\r\n$entryday = get_the_time('U');\r\n$kijiday = date('U',($today - $entryday)) \/ 86400 ;\r\nif( $days > $kijiday ){\r\necho 'NEW';\r\n}\r\n?>\r\n<\/pre>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/http:\/\/agn.jp\/blog\/?p=1596\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"WordPress\u306b\u4fbf\u5229\u306a\u30bd\u30fc\u30b9\u3002\" data-hatena-bookmark-layout=\"simple-balloon\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img loading=\"lazy\" decoding=\"async\" src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>        <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"http:\/\/agn.jp\/blog\/?p=1596\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>        <div class=\"wsbl_facebook_share\"><div id=\"fb-root\"><\/div><fb:share-button href=\"http:\/\/agn.jp\/blog\/?p=1596\" type=\"button_count\" ><\/fb:share-button><\/div>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"http:\/\/agn.jp\/blog\/?p=1596\" data-text=\"WordPress\u306b\u4fbf\u5229\u306a\u30bd\u30fc\u30b9\u3002\" data-lang=\"ja\">Tweet<\/a><\/div>        <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"http:\/\/agn.jp\/blog\/?p=1596\" ><\/g:plusone><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u79c1\u304cWordPress\u3067\u69cb\u7bc9\u3059\u308b\u969b\u306b\u8ffd\u52a0\u3057\u3066\u3044\u308b \u4fbf\u5229\u306a\u30bd\u30fc\u30b9\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002 funtions.php\u306b\u8a18\u8ff0\u3059\u308b\u4fbf\u5229\u306a\u30bd\u30fc\u30b9 \u3010\u56fa\u5b9a\u30da\u30fc\u30b8\u5185\u306e\u753b\u50cfURL\u3092\u7c21\u5358\u306b\u3059\u308b\u3011 \u56fa\u5b9a\u30da\u30fc\u30b8\u5185\u3067\u753b\u50cf\u3092\u4f7f\u3046\u969b\u306b\u300eget_blog &hellip; <a href=\"http:\/\/agn.jp\/blog\/?p=1596\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">WordPress\u306b\u4fbf\u5229\u306a\u30bd\u30fc\u30b9\u3002<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[8],"tags":[],"class_list":["post-1596","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1596"}],"version-history":[{"count":0,"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1596\/revisions"}],"wp:attachment":[{"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1596"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/agn.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}