Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: New Blog Tempalte
- */
- get_header(); ?>
- <div id="content">
- <div id="contentleft">
- <div class="postarea">
- <?php if (have_posts()) : while (have_posts()) : the_post();
- $blog_category = get_post_meta($post->ID, 'blog-category', true);
- $blog_type = get_post_meta($post->ID, 'blog-type', true);
- $blog_category_pages = get_post_meta($post->ID, 'blog-category-pages', true);
- $blog_category_share = get_post_meta($post->ID, 'blog-category-share', true);
- $blog_category_headline = get_post_meta($post->ID, 'blog-category-headline', true);
- $blog_show_gallery = get_post_meta($post->ID, 'blog-show-gallery', true);
- ?>
- <h1 class="page-title"><?php the_title(); ?></h1>
- <?php if($blog_show_gallery == 'yes') { if ( function_exists( 'get_smooth_slider' ) ) { get_smooth_slider(); } } ?>
- <?php wp_reset_query(); the_content(__('Read more')); ?>
- <div style="clear:both;"></div>
- <?php endwhile; else: ?>
- <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
- <?php
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $args=array(
- 'caller_get_posts'=>1,
- 'cat'=>$blog_category,
- 'posts_per_page'=>$blog_category_pages,
- 'post_type'=> $blog_type,
- 'paged'=>$paged,
- );
- query_posts($args);
- ?>
- <h2 class="page-title"><?php echo $blog_category_headline; ?></h2>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <div class="article-list">
- <?php
- $attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC'));
- if ( ! is_array($attachments) ) continue;
- $count = count($attachments);
- $first_attachment = array_shift($attachments);
- $url = wp_get_attachment_url($first_attachment->ID);
- if(empty($url)) { $url = get_bloginfo('template_directory').'/images/no-image.png'; } ?>
- <a class="alignleft shadow" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
- <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $url; ?>&w=175&h=175&zc=1" alt="<?php the_title(); ?>"/>
- </a>
- <div class="date"><?php the_time('F j, Y'); ?></div>
- <h3><a href="<?php the_permalink() ?>" rel="Read more"><?php the_title(); ?></a></h3>
- <?php the_excerpt(__('Read more'));?>
- <div style="clear:both;"></div>
- <div class="read-more">
- <h5><a href="<?php the_permalink() ?>" title="Continue reading about <?php the_title();?>" >Continue Reading</a></h5>
- </div>
- </div>
- <?php endwhile; ?>
- <?php else: ?>
- <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
- <?php endif; ?>
- <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>
- <div style="clear:both;"></div>
- </div>
- </div>
- <div class="shadow" id="sidebar">
- <ul class="tab" id="sidebarwidgeted">
- <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Category') ) : ?>
- <?php endif; ?>
- </ul>
- </div>
- </div>
- <!-- The main column ends -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement