This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("#type").each(function() { | |
| var $this = $(this); | |
| var str = $this.text(); | |
| $this.empty().show(); | |
| str = str.split(""); | |
| str.push("|"); | |
| // increase the delay to ghostType slower | |
| var delay = 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_shortcode('field', 'shortcode_field'); | |
| function shortcode_field($atts){ | |
| extract(shortcode_atts(array( | |
| 'post_id' => NULL, | |
| ), $atts)); | |
| if(!isset($atts[0]) return; | |
| $field = esc_attr($atts[0]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| register_taxonomy( | |
| 'com_category', array('foo', 'bar','hoge','fuga'),array( | |
| 'label' => '共通カテゴリ', | |
| 'hierarchical' => true, | |
| 'show_ui' => true, | |
| 'query_var' => true, | |
| )); | |
| ?> | |
| /*'com_category', array('投稿タイプA', '投稿タイプB','投稿タイプC','投稿タイプD')*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| get_role('author')->add_cap('manage_categories'); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'media_send_to_editor', 'disable_a_tags_in_gallery', 999, 3 ); | |
| function disable_a_tags_in_gallery( $html ) { | |
| return preg_replace( '/<a .*?>(.*?)<\/a>/', '$1', $html ); | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php echo get_the_term_list( $post->ID, 'foo', '', ',', '' ) ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if(is_tax()) { | |
| $taxonomy = get_taxonomy(get_query_var('foo')); | |
| echo sprintf('%s', single_term_title('', false)); | |
| } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://example.com/?s=foo&feed=rss2 | |
| /*「foo」の検索結果のRSS*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if (strlen($post->post_title) > 30) { | |
| echo mb_substr(the_title($before = '', $after = '', FALSE), 0, 30) . '...'; } else { | |
| the_title(); | |
| } ?> | |
| /*上記は30文字以降「...」で省略される*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ( !function_exists('base_rss_feed') ) { | |
| function base_rss_feed($size = 5, $feed = 'http://wordpress.org/news/feed/', $date = false, $cache_time = 1800) | |
| { | |
| include_once ABSPATH . WPINC . '/feed.php'; | |
| add_filter( 'wp_feed_cache_transient_lifetime', create_function( '$a', "return $cache_time;" ) ); | |
| $rss = fetch_feed($feed); | |
| if ( !is_wp_error( $rss ) ) { | |
| $maxitems = $rss->get_item_quantity($size); |