Advertisement
towfiqi

layout1.php

Feb 7th, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. <?php global $asteria;?>
  2. <div class="lay1">
  3. <div class="center">
  4.  
  5. <?php if ( is_home() ) { ?>
  6. <div class="homeposts_title">
  7. <?php echo $asteria['posts_title_id']; ?>
  8. </div>
  9. <?php }?>
  10.  
  11. <div class="lay1_wrap">
  12. <?php if(have_posts()): ?><?php while(have_posts()): ?><?php the_post(); $counter++; ?>
  13. <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  14.  
  15. <?php global $wp_query; $postid = $wp_query->post->ID; $astvidthumb = get_post_meta( $postid, 'ast_videolink', true ); ?>
  16. <?php if ( ! empty ( $astvidthumb ) ) { ?>
  17. <div class="vidwrap">
  18. <!--VIDEO THUMBNAIL-->
  19. <?php $astvidthumb =str_replace('https://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $astvidthumb);?>
  20. <div class="ast_vid"><div class="responsive-container"><iframe src="<?php echo $astvidthumb; ?>?rel=0&amp;autohide=1&amp;showinfo=0"></iframe></div></div>
  21.  
  22. <div class="post_content">
  23. <h2 class="postitle"><a href="<?php the_permalink();?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  24. </div>
  25. </div>
  26. <?php } else { ?>
  27.  
  28. <?php if($counter == 1){ ?>
  29. <div class="post_image">
  30. <div class="img_hover">
  31. <div class="icon_wrap">
  32. <div class="icon_round"><a href="<?php the_permalink();?>"><i class="fa-link fa-2x"></i></a></div>
  33. </div>
  34. </div>
  35. <!--CALL POST IMAGE-->
  36. <?php if ( has_post_thumbnail() ) : ?>
  37.  
  38. <div class="imgwrap">
  39. <a href="<?php the_permalink();?>"><?php the_post_thumbnail('asteriathumb'); ?></a></div>
  40.  
  41. <?php elseif($photo = asteria_get_images('numberposts=1', true)): ?>
  42. <div class="imgwrap">
  43. <a href="<?php the_permalink();?>"><?php echo wp_get_attachment_image($photo[0]->ID ,'medium'); ?></a></div>
  44.  
  45. <?php else : ?>
  46. <div class="imgwrap">
  47. <a href="<?php the_permalink();?>"><img src="<?php echo get_template_directory_uri(); ?>/images/blank_img.png" alt="<?php the_title_attribute(); ?>" class="thn_thumbnail"/></a></div>
  48.  
  49. <?php endif; ?>
  50.  
  51. <?php } ?>
  52. <!--POST CONTENT-->
  53. <div class="post_content">
  54. <h2 class="postitle"><a href="<?php the_permalink();?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  55. </div>
  56.  
  57. </div>
  58.  
  59. <?php } ?>
  60.  
  61.  
  62.  
  63.  
  64.  
  65. </div>
  66. <?php endwhile ?>
  67.  
  68. <?php endif ?>
  69. </div>
  70.  
  71.  
  72.  
  73. <!--PAGINATION START-->
  74. <div class="ast_pagenav">
  75. <?php
  76. global $wp_query;
  77. $big = 999999999; // need an unlikely integer
  78. echo paginate_links( array(
  79. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
  80. 'format' => '?paged=%#%',
  81. 'current' => max( 1, get_query_var('paged') ),
  82. 'total' => $wp_query->max_num_pages,
  83. 'show_all' => true,
  84. 'prev_next' => false
  85.  
  86. ) );
  87. ?>
  88. </div>
  89. <!--PAGINATION END-->
  90.  
  91. <?php wp_reset_query(); ?>
  92. </div>
  93. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement