Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Blog List - Sorted by date
- */
- ?>
- <?php get_header(); ?>
- <div class="content-wrap">
- <div class="content">
- <?php tie_breadcrumbs() ?>
- <?php if( get_query_var('page') ) $paged = get_query_var('page') ; ?>
- <?php if ( ! have_posts() ) : ?>
- <div id="post-0" class="post not-found post-listing">
- <h1 class="post-title"><?php _e( 'Not Found', 'tie' ); ?></h1>
- <div class="entry">
- <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'tie' ); ?></p>
- <?php get_search_form(); ?>
- </div>
- </div>
- <?php endif; ?>
- <div class="page-head">
- <h1 class="page-title">
- <?php the_title(); ?>
- </h1>
- </div>
- <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
- <?php $get_meta = get_post_custom($post->ID); ?>
- <?php get_template_part( 'includes/post-head' ); ?>
- <div class="entry"><?php the_content(); ?></div>
- <?php endwhile; ?>
- <?php //Above Post Banner
- if( empty( $get_meta["tie_hide_above"][0] ) ){
- if( !empty( $get_meta["tie_banner_above"][0] ) ) echo '<div class="ads-post">' .htmlspecialchars_decode($get_meta["tie_banner_above"][0]) .'</div>';
- else tie_banner('banner_above' , '<div class="ads-post">' , '</div>' );
- }
- ?>
- <?php
- $tie_blog_cats = unserialize($get_meta["tie_blog_cats"][0]);
- if( empty( $tie_blog_cats ) ) $tie_blog_cats = get_all_category_ids();
- $blog_query = array(
- 'orderby' => 'date',
- 'order' => 'DESC',
- 'paged' => $paged ,
- 'category__in' => $tie_blog_cats
- );
- query_posts( $blog_query );
- echo "<pre style='display: none;'>";
- echo "Is this the main query?: " . (is_main_query() ? "yes" : "no" ) . PHP_EOL;
- echo "============================================================" . PHP_EOL;
- echo "\$blog_query:" . PHP_EOL;
- print_r($blog_query);
- echo "============================================================" . PHP_EOL;
- echo "\$wp_query:" . PHP_EOL;
- print_r($wp_query);
- echo "============================================================" . PHP_EOL;
- echo "\$query:" . PHP_EOL;
- print_r($query);
- echo "</pre>";
- get_template_part( 'loop', 'category' );
- if ($wp_query->max_num_pages > 1) tie_pagenavi(); ?>
- <?php //Below Post Banner
- if( empty( $get_meta["tie_hide_below"][0] ) ){
- if( !empty( $get_meta["tie_banner_below"][0] ) ) echo '<div class="ads-post">' .htmlspecialchars_decode($get_meta["tie_banner_below"][0]) .'</div>';
- else tie_banner('banner_below' , '<div class="ads-post">' , '</div>' );
- }
- ?>
- <?php comments_template( '', true ); ?>
- </div><!-- .content -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement