{"id":2565,"date":"2013-05-16T21:32:36","date_gmt":"2013-05-16T12:32:36","guid":{"rendered":"http:\/\/spica.tokyo.jp\/spica_ro\/?p=2564"},"modified":"2013-05-16T21:32:36","modified_gmt":"2013-05-16T12:32:36","slug":"wordpress%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba%e3%81%ae%e3%83%a1%e3%83%a2","status":"publish","type":"post","link":"https:\/\/spica.tokyo.jp\/spica_ro\/other\/2565\/","title":{"rendered":"WordPress\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306e\u30e1\u30e2"},"content":{"rendered":"<p>\u76f8\u5909\u308f\u3089\u305a\u306e\u4f53\u8abf\u4e0d\u826f\u3067\u3059\u3002<br \/>\n\u6bce\u65e5\u3053\u3093\u306a\u3053\u3068\u3070\u3063\u304b\u308a\u66f8\u3044\u3066\u3066\u3082\u3057\u3087\u3046\u304c\u306a\u3044\u306e\u3067\u3001\u4eca\u65e5\u306fWordpress\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306b\u3064\u3044\u3066\u306e\u30e1\u30e2\u3092\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u3084\u308a\u305f\u304b\u3063\u305f\u306e\u306f\u3001<a href=\"http:\/\/spica.rpd.jp\/mimir\/\">Mimir\u6c38\u90601\u6b21\u8077\u306e\u305f\u307e\u308a\u5834<\/a>\u306e\u30b5\u30a4\u30c9\u30d0\u30fc\u306b\u8868\u793a\u3057\u3066\u3042\u308b\u300c\u904e\u53bb\u30ed\u30b0\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u300d\u304c\u6708\u3054\u3068\u306e\u4e00\u89a7\u306b\u306a\u3063\u3066\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u3053\u308c\u304c\u6bce\u6708\u3069\u3093\u3069\u3093\u5897\u3048\u3066\u3060\u3089\u30fc\u3063\u3068\u3057\u3066\u308b\u306e\u3092\u30b9\u30c3\u30ad\u30ea\u3055\u305b\u305f\u3044\u306a\u3041\u2026\u3063\u3066\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3053\u306egoo\u30d6\u30ed\u30b0\u3060\u3068\u540c\u3058\u76ee\u7684\u306e\u300c\u30d0\u30c3\u30af\u30ca\u30f3\u30d0\u30fc\u300d\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u304c\u51fa\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u3068\u540c\u3058\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u601d\u3063\u305f\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u3044\u308d\u3044\u308d\u8abf\u3079\u3066\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u624b\u6bb5\u306f\u3059\u3050\u306b\u5206\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3069\u3053\u306b\u305d\u308c\u3092\u9069\u7528\u3059\u308c\u3070\u3044\u3044\u306e\u304b\u304c\u306a\u304b\u306a\u304b\u5206\u304b\u3089\u306a\u304f\u3066\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306fWordpress\u306b\u6a19\u6e96\u3067\u4ed8\u3044\u3066\u304f\u308b\u300cTwentyEleven\u300d\u3092\u4f7f\u7528\u3057\u3066\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u3042\u308b\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8(style.css)\u304b\u3089widget\u306b\u3064\u3044\u3066\u306e\u8a18\u8ff0\u3092\u63a2\u3057\u3066\u3001\u6b21\u306e\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>.widget-scroll {<br \/>\nheight:200px;<br \/>\noverflow:auto;<br \/>\n}<\/p>\n<p>\u610f\u5473\u5408\u3044\u306f\u300c\u9ad8\u3055\u304c200px\u3092\u8d85\u3048\u305f\u3089\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u8868\u793a\u300d\u3067\u3059\u3002<\/p>\n<p>\u554f\u984c\u306f\u3053\u306e\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u3092\u3069\u3053\u306b\u8a2d\u5b9a\u3059\u3079\u304d\u304b\uff1f\u3068\u3044\u3046\u3053\u3068\u3067\u3057\u305f\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u306b\u8868\u793a\u3055\u308c\u305f\u72b6\u614b\u3067\u30da\u30fc\u30b8\u30bd\u30fc\u30b9\u3092\u898b\u3066\u307f\u308b\u3068\u3001TwentyEleven\u30c6\u30fc\u30de\u306b\u3042\u308bsidebar.php\u306b\u8ffd\u52a0\u3059\u308c\u3070\u826f\u3055\u305d\u3046\u304b\u306a\uff1f\u3068\u601d\u3044\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>&lt;aside id=&quot;archives&quot; class=&quot;widget&quot;&gt;<\/p>\n<h3 class=\"widget-title\"><?php _e( 'Archives', 'twentyeleven' ); ?><\/h3>\n<p><\/p>\n<ul>class=&#8221;widget-scroll&#8221;<\/font>><br \/>\n<?php wp_get_archives( array( 'type' => &#8216;monthly&#8217; ) ); ?>\n<\/ul>\n<p>\u3067\u3082\u6b8b\u5ff5\u306a\u304c\u3089\u3001\u3053\u308c\u3067\u306f\u7d50\u679c\u306b\u306f\u53cd\u6620\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u3055\u3089\u306b\u3044\u308d\u3044\u308d\u8abf\u3079\u3066\u307f\u305f\u3089\u3001\u3069\u3046\u3084\u3089\u30c6\u30fc\u30de\u5185\u306ephp\u3067\u306f\u306a\u304f\u3001\/wp-includes\/default-widgets.php\u306e\u65b9\u3092\u5909\u66f4\u3059\u308c\u3070\u4f55\u3068\u304b\u306a\u308a\u305d\u3046\u3002<\/p>\n<p>sidebar.php\u3067\u3084\u3063\u305f\u306e\u3068\u540c\u3058\u3088\u3046\u306b\u3001Archives widget class\u306e\u9805\u76ee\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u8ffd\u52a0\u3057\u305f\u306e\u306ffunction widget\u306e\u4e2d\u306b\u3042\u308b<\/p>\n<ul>\u3067\u3059\u3002<\/p>\n<ul>class=&#8221;widget-scroll&#8221;<\/font>><\/p>\n<p>\u3053\u308c\u3067\u7121\u4e8b\u3001\u76ee\u7684\u901a\u308a\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u304c\u51fa\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3059\u304c\u2026\u3002<\/p>\n<p>\u306a\u3093\u304b\u3053\u308c\u3063\u3066\u3001\u3044\u307e\u3044\u3061\u30b9\u30de\u30fc\u30c8\u3058\u3083\u306a\u3044\u3067\u3059\u3088\u306d\u3047\u3002<\/p>\n<p>default-widgets.php\u3092\u30c6\u30fc\u30de\u306e\u65b9\u3067\u518d\u5b9a\u7fa9\u3067\u304d\u306a\u3044\u306e\u304b\u306a\u3041\u2026\u3068\u304b\u601d\u3046\u3093\u3067\u3059\u3088\u3002<\/p>\n<p>\u307e\u3060\u307e\u3060Wordpress\u306b\u3064\u3044\u3066\u306f\u7406\u89e3\u304c\u8db3\u308a\u3066\u306a\u304f\u3066\u3001\u3084\u3063\u3064\u3051\u4ed5\u4e8b\u3070\u304b\u308a\u306b\u306a\u3063\u3066\u308b\u306e\u3067\u3001\u3042\u308b\u7a0b\u5ea6\u6642\u9593\u3092\u304b\u3051\u3066\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u305f\u3044\u3082\u306e\u3067\u3059\u3002<\/p>\n<hr \/>\n<p>\n(2013\/11\/16\u8ffd\u8a18)<\/p>\n<p>\u30a2\u30fc\u30ab\u30a4\u30d6\u4e00\u89a7\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u4ed8\u3051\u308b\u65b9\u6cd5\u3067\u3059\u304c\u3001\u3082\u3046\u3061\u3087\u3063\u3068\u30b9\u30de\u30fc\u30c8\u306a\u65b9\u6cd5\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092\u9069\u5f53\u306a\u540d\u524d\u3092\u4ed8\u3051\u3066php\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002<br \/>\n\uff08\u6587\u5b57\u30b3\u30fc\u30c9\u306f UTF-8\u3001BOM\u306a\u3057\uff09<\/p>\n<p><?php<br \/>\n\/**<br \/>\n* @package SpArchivesScroll<br \/>\n* @version 0.1<br \/>\n*\/<br \/>\n\/*<br \/>\nPlugin Name: SpArchivesScroll<br \/>\nPlugin URI: http:\/\/spica.rpd.jp\/<br \/>\nDescription: Hoge Hoge Hoge<br \/>\nAuthor: Spica<br \/>\nVersion: 0.1<br \/>\nAuthor URI: http:\/\/spica.rpd.jp\/<br \/>\n*\/<br \/>\nfunction add_sparchivescroll_css() {<br \/>\n\/* CSS\u306e\u683c\u7d0d\u30d1\u30b9[<abbr class='c2c-text-hover' title='WordPress'>WP<\/abbr>-home]\/wp-content\/plugins\/sparchivescroll\/sparchivescroll.css *\/<br \/>\n$cssPath = WP_PLUGIN_DIR . &#8216;\/sparchivescroll\/sparchivescroll.css&#8217;;<\/p>\n<p>\/* CSS\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308c\u3070\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u3067CSS\u3092\u8ffd\u52a0\u3059\u308b *\/<br \/>\nif(file_exists($cssPath)){<br \/>\n\/* CSS\u306e\u683c\u7d0dURL *\/<br \/>\n$cssUrl = plugins_url(&#8216;sparchivescroll.css&#8217;, __FILE__);<br \/>\n\/* CSS\u767b\u9332 *\/<br \/>\nwp_register_style(&#8216;sparchivescroll&#8217;, $cssUrl);<br \/>\n\/* CSS\u8ffd\u52a0 *\/<br \/>\nwp_enqueue_style(&#8216;sparchivescroll&#8217;);<br \/>\n}<br \/>\n}<br \/>\n\/* \u30a2\u30af\u30b7\u30e7\u30f3\u30d5\u30c3\u30af *\/<br \/>\nadd_action(&#8216;wp_print_styles&#8217;, &#8216;add_sparchivescroll_css&#8217;);<\/p>\n<p>class Sp_Widget_Archives extends WP_Widget {<br \/>\nfunction __construct() {<br \/>\n$widget_ops = array(&#8216;classname&#8217; => &#8216;widget_archive&#8217;, &#8216;description&#8217; => __( &#8216;A monthly archive of your site&#8217;s posts&#8217;) );<br \/>\nparent::__construct(&#8216;archives&#8217;, __(&#8216;Archives&#8217;), $widget_ops);<br \/>\n}<\/p>\n<p>function widget( $args, $instance ) {<br \/>\nextract($args);<br \/>\n$c = ! empty( $instance[&#8216;count&#8217;] ) ? &#8216;1&#8217; : &#8216;0&#8217;;<br \/>\n$d = ! empty( $instance[&#8216;dropdown&#8217;] ) ? &#8216;1&#8217; : &#8216;0&#8217;;<br \/>\n$title = apply_filters(&#8216;widget_title&#8217;, empty($instance[&#8216;title&#8217;]) ? __(&#8216;Archives&#8217;) : $instance[&#8216;title&#8217;], $instance, $this->id_base);<\/p>\n<p>echo $before_widget;<br \/>\nif ( $title )<br \/>\necho $before_title . $title . $after_title;<\/p>\n<p>if ( $d ) {<br \/>\n?><br \/>\n&lt;select name=&quot;archive-dropdown&quot; onchange=&#039;document.location.href=this.options[this.selectedIndex].value;&#039;&gt; &lt;option value=&quot;&quot;&gt;<?php echo esc_attr(__('Select Month')); ?>&lt;\/option&gt; <?php wp_get_archives(apply_filters('widget_archives_dropdown_args', array('type' => &#8216;monthly&#8217;, &#8216;format&#8217; => &#8216;option&#8217;, &#8216;show_post_count&#8217; => $c))); ?> &lt;\/select&gt;<br \/>\n<?php<br \/>\n} else {<br \/>\n?><\/p>\n<ul class=\"widget-scroll\">\n<?php wp_get_archives(apply_filters('widget_archives_args', array('type' => &#8216;monthly&#8217;, &#8216;show_post_count&#8217; => $c))); ?>\n<\/ul>\n<p>\n<?php<br \/>\n}<\/p>\n<p>echo $after_widget;<br \/>\n}<\/p>\n<p>function update( $new_instance, $old_instance ) {<br \/>\n$instance = $old_instance;<br \/>\n$new_instance = wp_parse_args( (array) $new_instance, array( &#8216;title&#8217; => &#8221;, &#8216;count&#8217; => 0, &#8216;dropdown&#8217; => &#8221;) );<br \/>\n$instance[&#8216;title&#8217;] = strip_tags($new_instance[&#8216;title&#8217;]);<br \/>\n$instance[&#8216;count&#8217;] = $new_instance[&#8216;count&#8217;] ? 1 : 0;<br \/>\n$instance[&#8216;dropdown&#8217;] = $new_instance[&#8216;dropdown&#8217;] ? 1 : 0;<\/p>\n<p>return $instance;<br \/>\n}<\/p>\n<p>function form( $instance ) {<br \/>\n$instance = wp_parse_args( (array) $instance, array( &#8216;title&#8217; => &#8221;, &#8216;count&#8217; => 0, &#8216;dropdown&#8217; => &#8221;) );<br \/>\n$title = strip_tags($instance[&#8216;title&#8217;]);<br \/>\n$count = $instance[&#8216;count&#8217;] ? &#8216;checked=&#8221;checked&#8221;&#8216; : &#8221;;<br \/>\n$dropdown = $instance[&#8216;dropdown&#8217;] ? &#8216;checked=&#8221;checked&#8221;&#8216; : &#8221;;<br \/>\n?><\/p>\n<p>&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id(&#8216;title&#8217;); ?>&#8221;><?php _e('Title:'); ?>&lt;\/label&gt; &lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id(&#8216;title&#8217;); ?>&#8221; name=&#8221;<?php echo $this->get_field_name(&#8216;title&#8217;); ?>&#8221; type=&#8221;text&#8221; value=&#8221;<?php echo esc_attr($title); ?>&#8221; \/><\/p>\n<p><\/p>\n<p>\n&lt;input class=&quot;checkbox&quot; type=&quot;checkbox&quot; &lt;?php echo $dropdown; ?&gt; id=&#8221;<?php echo $this->get_field_id(&#8216;dropdown&#8217;); ?>&#8221; name=&#8221;<?php echo $this->get_field_name(&#8216;dropdown&#8217;); ?>&#8221; \/> &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id(&#8216;dropdown&#8217;); ?>&#8221;><?php _e('Display as dropdown'); ?>&lt;\/label&gt;<\/p>\n<p>&lt;input class=&quot;checkbox&quot; type=&quot;checkbox&quot; &lt;?php echo $count; ?&gt; id=&#8221;<?php echo $this->get_field_id(&#8216;count&#8217;); ?>&#8221; name=&#8221;<?php echo $this->get_field_name(&#8216;count&#8217;); ?>&#8221; \/> &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id(&#8216;count&#8217;); ?>&#8221;><?php _e('Show post counts'); ?>&lt;\/label&gt;\n<\/p>\n<p>\n<?php<br \/>\n}<br \/>\n}<\/p>\n<p>add_action(&#8216;widgets_init&#8217;, create_function(&#8221;, &#8216;return register_widget(&#8220;Sp_Widget_Archives&#8221;);&#8217;));<br \/>\n?><\/p>\n<p>\u4eca\u5ea6\u306f\u8a72\u5f53\u306eCSS\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>.widget-scroll {<br \/>\nheight:200px;<br \/>\noverflow:auto;<br \/>\n}<\/p>\n<p>height:200px; \u306e\u6570\u5024\u3092\u5909\u3048\u308b\u3053\u3068\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u306e\u9ad8\u3055\u3092\u8abf\u6574\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e2\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u9069\u5f53\u306a\u30d5\u30a9\u30eb\u30c0\u306b\u307e\u3068\u3081\u3066\u3001wp-content\/plugins\/ \u30d5\u30a9\u30eb\u30c0\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066Wordpress\u306e\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u6709\u52b9\u306b\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p>functions.php \u306b\u767b\u9332\u3057\u3066\u3082\u540c\u69d8\u306a\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76f8\u5909\u308f\u3089\u305a\u306e\u4f53\u8abf\u4e0d\u826f\u3067\u3059\u3002 \u6bce\u65e5\u3053\u3093\u306a\u3053\u3068\u3070\u3063\u304b\u308a\u66f8\u3044\u3066\u3066\u3082\u3057\u3087\u3046\u304c\u306a\u3044\u306e\u3067\u3001\u4eca\u65e5\u306fWordpress\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306b\u3064\u3044\u3066\u306e\u30e1\u30e2\u3092\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u3084\u308a\u305f\u304b\u3063\u305f\u306e\u306f\u3001Mimir\u6c38\u90601\u6b21\u8077\u306e\u305f\u307e\u308a\u5834\u306e\u30b5\u30a4\u30c9\u30d0\u30fc\u306b\u8868\u793a\u3057\u3066 &hellip; <a href=\"https:\/\/spica.tokyo.jp\/spica_ro\/other\/2565\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">WordPress\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306e\u30e1\u30e2<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-2565","post","type-post","status-publish","format-standard","hentry","category-other"],"_links":{"self":[{"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/posts\/2565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/comments?post=2565"}],"version-history":[{"count":0,"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/posts\/2565\/revisions"}],"wp:attachment":[{"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/media?parent=2565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/categories?post=2565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spica.tokyo.jp\/spica_ro\/wp-json\/wp\/v2\/tags?post=2565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}