<?php
get_header();
if (have_posts()): ?>
<?php
while (have_posts()) : the_post(); ?>
<li class="postWrapper" id="post-<?php the_ID(); ?>">
<h3 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div id="postdata">
<div class="search-content">
<?php the_excerpt(__('<p>Read More ></p>')); ?>
</div>
<div class="entry-meta">
<?php
$view_in_browser = '<a class="google-viewer" href="http://docs.google.com/viewer?url='.$attachment_url.'">View document in browser</a>';
$download = '<a class="download" href="'.$attachment_url.'">Download PDF</a>';
echo $view_in_browser . ' ' . $download;
?>
</div>
</div>
<hr />
</li>
<?php endwhile; ?>
<?php
global $wp_rewrite;
$wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;
$pagination = array(
'base' => @add_query_arg('page','%#%'),
'format' => '',
'total' => $wp_query->max_num_pages,
'current' => $current,
'show_all' => true,
'type' => 'plain',
);
if( $wp_rewrite->using_permalinks() )
$pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged');
if( !empty($wp_query->query_vars['s']) )
$pagination['add_args'] = array('s'=>get_query_var('s'));
echo paginate_links($pagination);
?>
<?php else: ?>
<h3 style="text-align:center; font-weight:bold; color:#333;"><?php _e('Sorry, no posts matched your criteria.'); ?></h3>
<p style="text-align:center">Please try Searching anohter term.</p>
<?php
endif;
?>
<?php if (will_paginate()): ?>
<?php endif; ?>
<?php
get_footer();
?>