Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Archives
- */
- get_header();
- function remove_sharedaddy(){
- // if sharing_display() function does not exist, return
- if( ! function_exists( 'sharing_display' ) )
- return;
- // remove the callback sharing_display() for the 'the_content' filter.
- remove_filter( 'the_content', 'sharing_display', 19 );
- }
- ?>
- <div class="intro">
- <h1><?php single_cat_title(); ?> Category Archives</h1>
- </div>
- <div class="wrapper clearfix">
- <div class="content" role="main">
- <div class="sidebar-content">
- <?php get_sidebar(); ?>
- </div>
- <div class="main-content">
- <?php
- $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
- $args=array(
- 'post_type' => 'post',
- 'post_status' => 'publish',
- 'paged' => $paged,
- 'caller_get_posts'=> 1
- );
- $my_query = null;
- $my_query = new WP_Query($args);
- if( $my_query->have_posts() ) {
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <?php
- global $more;
- $more = 0;
- ?>
- <h2 class="heading2 entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <div class="meta-box">
- <?php echo get_avatar( get_the_author_meta('user_email'), $size = '30'); ?><p>By <?php the_author_link(); ?> on <?php the_date(); ?> </p>
- </div>
- <?php
- the_post_thumbnail( 'full' );
- remove_sharedaddy();
- the_content(__('<br />Read More</div>'));
- ?>
- <?php
- endwhile;
- $big = 999999999; // need an unlikely integer
- ?>
- <div id="pagination">
- <?php
- echo paginate_links( array(
- 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
- 'format' => '?paged=%#%',
- 'current' => max( 1, get_query_var('paged') ),
- 'total' => $my_query->max_num_pages
- ) );
- ?>
- </div>
- <?php
- }
- wp_reset_query(); // Restore global post data stomped by the_post().
- ?>
- </div>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement