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 | |
| $my_theme = wp_get_theme(); | |
| // Echo the name of the current active theme. | |
| echo $my_theme; // wp_get_theme() | |
| // Display the Current Theme's Version | |
| echo $my_theme->Name . " is version " . $my_theme->Version; | |
| // Display the Current Theme Author URI |
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 | |
| /** | |
| * 投稿内でコメントアウトできるようにする | |
| */ | |
| function ignore_shortcode( $atts, $content = null ) { | |
| return null; | |
| } | |
| add_shortcode( 'ignore', 'ignore_shortcode', '9999' ); |
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 | |
| function search_filter($query) { | |
| if ( is_admin() || ! $query->is_main_query() ) | |
| return; | |
| if ( $query->is_search() ) { | |
| $query->set( 'category__not_in', array( 1 ) ); | |
| return; | |
| } | |
| } |
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 | |
| comment_form( array( 'class_submit' => 'button' ) ); |
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 | |
| function bootstrap_comment_form_default_fields( $fields ) { | |
| foreach ( $fields as $field => $value ) { | |
| $value = preg_replace( | |
| '/comment-form-([^\"|^\']*)/i', | |
| 'comment-form-\1 form-group', | |
| $value | |
| ); |
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
| .left-double-border { | |
| border-left: solid 6px red; | |
| padding-left: 2px; | |
| } | |
| .left-double-border:before { | |
| content: " "; | |
| border-left: solid 2px red; | |
| margin-right: 10px; | |
| padding: 4px 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
| <div id='gallery-1' class='gallery galleryid-555 gallery-columns-3 gallery-size-thumbnail'> | |
| <div class="gallery-bxslider"> | |
| <figure class='slider-item' data-href='/archives/555/canola2'> | |
| <div class='slider-icon landscape'> | |
| <img width="640" height="480" src="http://example.com/wp-content/uploads/2011/01/canola2.jpg" /> | |
| </div> | |
| <figcaption class='slider-caption-text slider-caption' id='gallery-1-611'> | |
| caption text. | |
| </figcaption> | |
| </figure> |
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 | |
| /** | |
| * Filter the except length to 20 characters. | |
| * | |
| * @param int $length Excerpt length. | |
| * @return int (Maybe) modified excerpt length. | |
| */ | |
| function wpdocs_custom_excerpt_length( $length ) { | |
| return 20; | |
| } |
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 | |
| // 指定した固定ページが属する先祖・子孫全て表示 | |
| // 指定がない場合は表示している固定ページ | |
| function view_all_family_page_link( $post_id = '' ) { | |
| if ( empty( $post_id ) ) { | |
| if ( ! is_page() ) { | |
| return; | |
| } | |
| global $post; |