Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.27 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: New Blog Tempalte
  4. */
  5. get_header(); ?>
  6.  
  7. <div id="content">
  8.  
  9.     <div id="contentleft">
  10.    
  11.         <div class="postarea">
  12.    
  13.                 <?php if (have_posts()) : while (have_posts()) : the_post();
  14.         $blog_category = get_post_meta($post->ID, 'blog-category', true);
  15.         $blog_type = get_post_meta($post->ID, 'blog-type', true);
  16.         $blog_category_pages = get_post_meta($post->ID, 'blog-category-pages', true);
  17.         $blog_category_share = get_post_meta($post->ID, 'blog-category-share', true);
  18.         $blog_category_headline = get_post_meta($post->ID, 'blog-category-headline', true);
  19.         $blog_show_gallery = get_post_meta($post->ID, 'blog-show-gallery', true);
  20.         ?>
  21.            
  22.             <h1 class="page-title"><?php the_title(); ?></h1>
  23.  
  24.             <?php if($blog_show_gallery == 'yes') { if ( function_exists( 'get_smooth_slider' ) ) {  get_smooth_slider(); } } ?>
  25.  
  26.             <?php wp_reset_query(); the_content(__('Read more')); ?>
  27.  
  28.             <div style="clear:both;"></div>
  29.  
  30.             <?php endwhile; else: ?>
  31.            
  32.             <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
  33.            
  34. <?php
  35. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  36. $args=array(
  37.    'caller_get_posts'=>1,
  38.    'cat'=>$blog_category,
  39.    'posts_per_page'=>$blog_category_pages,
  40.    'post_type'=> $blog_type,
  41.    'paged'=>$paged,
  42.    );
  43. query_posts($args);
  44. ?>
  45.  
  46.             <h2 class="page-title"><?php echo $blog_category_headline; ?></h2>
  47.  
  48.                     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  49.  
  50.             <div class="article-list">
  51.  
  52. <?php
  53.       $attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC'));
  54.       if ( ! is_array($attachments) ) continue;
  55.       $count = count($attachments);
  56.       $first_attachment = array_shift($attachments);
  57.       $url = wp_get_attachment_url($first_attachment->ID);
  58.  if(empty($url)) { $url = get_bloginfo('template_directory').'/images/no-image.png'; } ?>
  59.  
  60.             <a class="alignleft shadow" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  61.                 <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $url; ?>&w=175&h=175&zc=1" alt="<?php the_title(); ?>"/>
  62.             </a>
  63.  
  64.             <div class="date"><?php the_time('F j, Y'); ?></div>
  65.  
  66.             <h3><a href="<?php the_permalink() ?>" rel="Read more"><?php the_title(); ?></a></h3>
  67.  
  68.             <?php the_excerpt(__('Read more'));?>
  69.  
  70.             <div style="clear:both;"></div>
  71.  
  72.                 <div class="read-more">
  73.                     <h5><a href="<?php the_permalink() ?>" title="Continue reading about <?php the_title();?>" >Continue Reading</a></h5>  
  74.                 </div>              
  75.                        
  76.                     </div>
  77.  
  78.             <?php endwhile; ?>
  79.  
  80.             <?php else: ?>
  81.            
  82.             <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
  83.  
  84.             <?php endif; ?>
  85.  
  86.      
  87.  <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>
  88.  
  89. <div style="clear:both;"></div>
  90.  
  91.         </div>     
  92.     </div>
  93.    
  94.     <div class="shadow" id="sidebar">
  95.         <ul class="tab" id="sidebarwidgeted">
  96.         <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Category') ) : ?>              
  97.         <?php endif; ?>
  98.         </ul>      
  99.     </div>
  100.        
  101. </div>
  102.  
  103. <!-- The main column ends  -->
  104.  
  105. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement