Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $s = $_POST['s'];
- query_posts('s='.$s.'');
- if (have_posts()) : while (have_posts()) : the_post();
- ?>
- <div class="box">
- <div class="box-holder">
- <div class="box-frame">
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- <em class="meta"><?php ehrscope_posted_on(); ?> | <span class="total-comments"><?php comments_popup_link(); ?></span></em>
- <?php
- if (!is_single() && has_excerpt()):
- the_excerpt();
- else:
- the_content(__('Continue reading', 'ehrscope') . ': <em>' . the_title('', '', false) . '</em>');
- endif;
- ?>
- <div class="clear"></div>
- <?php
- if (is_single()):
- ehrscope_wp_link_pages();
- $tags = wp_get_post_tags($post->ID);
- ?>
- <p class="entry-meta"><?php ehrscope_show_tags(); ?></p>
- <?php if ($tags): ?>
- <a href="javascript:void(0);" id="toggle-related-posts" class="button"><?php _e('Show Related Posts', 'ehrscope'); ?></a>
- <?php
- endif;
- endif;
- ?>
- </div>
- </div>
- </div>
- </div>
- <?php if (is_single()): ?>
- <div class="box" id="related-posts-cage">
- <div class="box-holder">
- <div class="box-frame">
- <div>
- <?php if (is_single()): ?>
- <?php
- if ($tags):
- $tag_ids = array();
- foreach ($tags as $individual_tag) {
- $tag_ids[] = $individual_tag->term_id;
- }
- $args = array(
- 'tag__in' => $tag_ids,
- 'post__not_in' => array($post->ID),
- 'posts_per_page' => 10, // Number of related posts to display.
- 'caller_get_posts' => 1
- );
- $my_query = new WP_Query($args);
- if ($my_query->have_posts()):
- ?>
- <h3><?php _e('Related Posts', 'ehrscope'); ?></h3>
- <ul>
- <?php
- while ($my_query->have_posts()) : $my_query->the_post();
- ?>
- <li>
- <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
-
- <!-- <span class="related-posts-date"><?php the_time('F jS, Y'); ?></span>-->
- </li>
- <?php
- endwhile;
- ?>
- </ul>
- <?php
- endif;
- endif;
- endif;
- ?>
- </div>
- </div>
- </div>
- </div>
- <?php
- endif;
- comments_template('', true);
- endwhile;
- else:
- ?>
- <div class="box">
- <div class="box-holder">
- <div class="box-frame">
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h2><?php _e('No Results', 'ehrscope'); ?></h2>
- <p><?php _e('Sorry, no posts matched your criteria.', 'ehrscope'); ?></p>
- </div>
- </div>
- </div>
- </div>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement