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 elseif(is_404()) : ?> | |
| <h1>404 NOT FOUND ERROR!!</h1> | |
| <p>指定したページが見つかりませんでした。</p> | |
| <?php endif; ?> | |
| <?php endif; ?> | |
| </div><!-- /#content --> |
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
| //変更前 | |
| <ul> | |
| <?php while ($r->have_posts()) : $r->the_post(); ?> | |
| <li><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li> | |
| <?php endwhile; ?> | |
| </ul> | |
| //変更後 | |
| <ul> | |
| <?php while ($r->have_posts()) : $r->the_post(); ?> |
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
| function SearchFilter($query) { | |
| if ($query->is_search) { | |
| $query->set('post_type', 'post'); | |
| } | |
| return $query; | |
| } | |
| add_filter('pre_get_posts', 'SearchFilter'); | |
| if (isset($_GET['s'])) { | |
| $_GET['s'] = mb_convert_kana($_GET['s'], 's', 'UTF-8'); |
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 else: ?> | |
| <?php if (is_search()) : ?> | |
| <?php echo $search_result; ?> | |
| <?php elseif(is_404()) : ?> | |
| <?php endif; ?> | |
| <?php endif; ?> | |
| </div><!-- /#content --> |
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="content"> | |
| <?php if (is_search()) : ?> | |
| <?php $allsearch =& new WP_Query("s=$s&showposts=-1"); ?> | |
| <?php $key = wp_specialchars($s, 1); ?> | |
| <?php $count = $allsearch->post_count; ?> | |
| <?php $search_result = '<p id="search_result">『<span class="search">'.$key.'</span>』で検索した結果、<span class="search">'.$count.'</span>件がヒットしました。</p>'; ?> | |
| <?php endif; ?> | |
| <?php if (have_posts()) : ?> | |
| <?php if (is_search()) : ?> | |
| <?php echo $search_result; ?> |
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
| <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> | |
| <input type="text" value="<?php echo $_GET['s']; ?>" name="s" id="s" /> | |
| <input type="submit" id="searchsubmit" value="" /> | |
| </form> |
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><!-- /#content --> | |
| <div id="sidebar"> | |
| <ul> | |
| <?php dynamic_sidebar(); ?> | |
| </ul> | |
| </div><!-- /#sidebar --> | |
| </div><!-- /#container --> |
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
| register_sidebar(); |
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 the_content('続きを読む'); ?> | |
| <?php comments_template(); ?> | |
| </article><!-- /.article --> |
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_single()) : ?> | |
| <?php wp_pagenavi(); ?> | |
| <?php endif; ?> |