Advertisement
towfiqi

page-blog.php

Jan 22nd, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Blog Page Template
  4. */
  5. ?>
  6. <?php global $asteria;?>
  7. <?php get_header(); ?>
  8.  
  9. <div class="fixed_site">
  10. <!--BIG PAGE HEADER START-->
  11. <div class="fixed_wrap singlefx">
  12. <?php if(($asteria['page_type_id']) == '1'){ ?>
  13. <div class="page_tt">
  14. <div class="center"><h1 class="postitle"><?php the_title(); ?></h1></div>
  15. </div>
  16. <?php } ?>
  17. <!--BIG PAGE HEADER END-->
  18.  
  19. <div class="lay4">
  20. <div class="center">
  21.  
  22. <div class="lay4_wrap<?php if ( !is_active_sidebar( 'sidebar' ) ) { ?> no_sidebar<?php } ?>">
  23. <div class="lay4_inner">
  24. <?php
  25.  
  26. $args = array(
  27. 'post_type' => 'post',
  28. 'cat' => ''.$asteria['blog_cat_id'].'',
  29. 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
  30. 'posts_per_page' => '20');
  31. $the_query = new WP_Query( $args );
  32. ?>
  33. <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  34. <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  35.  
  36. <?php global $the_query; $postid = $the_query->post->ID; $astvidthumb = get_post_meta( $postid, 'ast_videolink', true ); ?>
  37. <?php if ( ! empty ( $astvidthumb ) ) { ?>
  38. <div class="post_image">
  39. <!--VIDEO THUMBNAIL-->
  40. <?php $astvidthumb =str_replace('https://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $astvidthumb);?>
  41. <div class="ast_vid"><div class="responsive-container"><iframe src="<?php echo $astvidthumb; ?>?rel=0&amp;autohide=1&amp;showinfo=0"></iframe></div></div>
  42.  
  43. </div>
  44. <?php } else { ?>
  45.  
  46. <div class="post_image">
  47. <!--CALL TO POST IMAGE-->
  48. <?php if ( has_post_thumbnail() ) : ?>
  49. <div class="imgwrap">
  50. <a href="<?php the_permalink();?>"><?php the_post_thumbnail('medium'); ?></a></div>
  51.  
  52. <?php elseif($photo = asteria_get_images('numberposts=1', true)): ?>
  53.  
  54. <div class="imgwrap">
  55. <a href="<?php the_permalink();?>"><?php echo wp_get_attachment_image($photo[0]->ID ,'medium'); ?></a></div>
  56.  
  57. <?php else : ?>
  58.  
  59. <div class="imgwrap">
  60. <a href="<?php the_permalink();?>"><img src="<?php echo get_template_directory_uri(); ?>/images/blank_img.png" alt="<?php the_title_attribute(); ?>" class="asteria_thumbnail"/></a></div>
  61.  
  62. <?php endif; ?>
  63. </div>
  64. <?php } ?>
  65.  
  66. <div class="post_content">
  67. <h2 class="postitle"><a href="<?php the_permalink();?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  68. <!--POST INFO START-->
  69. <?php if (!empty ($asteria['post_info_id'])) { ?>
  70. <div class="single_metainfo">
  71. <i class="fa-calendar"></i><a class="comm_date"><?php the_time( get_option('date_format') ); ?></a>
  72. <i class="fa-user"></i><a class="meta_auth"><?php the_author(); ?></a>
  73. <i class="fa-comments"></i><?php if (!empty($post->post_password)) { ?>
  74. <?php } else { ?><div class="meta_comm"><?php comments_popup_link( __('0 Comment', 'asteria'), __('1 Comment', 'asteria'), __('% Comments', 'asteria'), '', __('Off' , 'asteria')); ?></div><?php } ?>
  75.  
  76. <i class="fa-th-list"></i><div class="catag_list"><?php the_category(', '); ?></div>
  77. </div>
  78. <?php } ?>
  79. <!--POST INFO END-->
  80.  
  81. <!--POST CONTENT START-->
  82. <?php the_excerpt(); ?>
  83. <!--POST CONTENT END-->
  84. </div>
  85.  
  86. </div>
  87. <?php endwhile ?>
  88.  
  89. <?php wp_reset_postdata(); ?>
  90. </div>
  91.  
  92. <!--PAGINATION START-->
  93. <div class="ast_pagenav">
  94. <?php
  95. global $wp_query;
  96. $big = 999999999; // need an unlikely integer
  97. echo paginate_links( array(
  98. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
  99. 'format' => '?paged=%#%',
  100. 'current' => max( 1, get_query_var('paged') ),
  101. 'total' => $wp_query->max_num_pages,
  102. 'show_all' => true,
  103. 'prev_next' => false
  104.  
  105. ) );
  106. ?>
  107. </div>
  108. <!--PAGINATION END-->
  109.  
  110. </div>
  111. <!--SIDEBAR START-->
  112. <?php if ( is_active_sidebar( 'sidebar' ) ) { ?><?php get_sidebar();?><?php } ?>
  113. <!--SIDEBAR END-->
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement