Guest User

Untitled

a guest
Jan 8th, 2014
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. Template Name: News Page
  6.  
  7.  
  8. */
  9.  
  10.  
  11. get_header(); ?>
  12.  
  13. <div class="container">
  14. <ol class="col-md-4 breadcrumb">
  15. <li><a href="<?php echo get_site_url(); ?>">Home</a></li>
  16. <li class="active">News</li>
  17. </ol>
  18. </div>
  19. <?php
  20. $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
  21. $args = array (
  22. 'post_type' => 'news',
  23. 'posts_per_page' => 2,
  24. 'paged' => $paged
  25. );
  26. $the_query = new WP_Query( $args );
  27. ?>
  28.  
  29. <?php
  30. $posts =1;
  31. ?>
  32.  
  33. <div class="container news">
  34.  
  35. <div class="col-md-3">
  36.  
  37. <?php
  38. if ($posts == 1) {
  39. global $wp_query;
  40. $postid = $wp_query->post->ID;
  41. get_post_meta($postid, 'title_youtube_link', true);
  42. wp_reset_query();
  43.  
  44. echo '<h5>';
  45. echo the_field('title_youtube_link');
  46. echo'</h5>';
  47.  
  48. global $wp_query;
  49. $postid = $wp_query->post->ID;
  50. get_post_meta($postid, 'youtube_link', true);
  51. wp_reset_query();
  52.  
  53. $meta = get_post_meta(get_the_ID(), 'video', true);
  54. $content = apply_filters('the_content', get_field('youtube_link') );
  55. echo $content;
  56.  
  57. the_content();
  58. echo '<div style="padding-top: 35px;"></div>';
  59. dynamic_sidebar('news_taxonomy');
  60. echo '<div style="padding-bottom: 35px;"></div>';
  61. }
  62. $posts++; ?>
  63. </div>
  64. <div class=" col-md-8 col-md-offset-1">
  65.  
  66. <script>
  67. boxes = $('.news-height');
  68. minHeight = Math.min.apply(
  69. Math, boxes.map(function() {
  70. return $(this).height();
  71. }).get());
  72. boxes.height(minHeight);
  73. </script>
  74.  
  75. <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query -> the_post(); ?>
  76.  
  77. <div class=" news-style well" >
  78.  
  79. <a href="<?php the_permalink(); ?>"><h4 class="bold_this"><?php the_field('title_of_the_news'); ?>&rarr;</h4></a>
  80.  
  81. <ul class="info">
  82. <li>Posted in: <?php echo get_the_term_list( $post->ID, 'news_type','',','); ?> </li>
  83. <li>Added by: <a href="<?php bloginfo('siteurl') ;?>/about/"><?php the_author(); ?></a></li>
  84. <li>On: <?php the_time('F j, Y'); ?></li>
  85. </ul>
  86. <br><br>
  87. <?php the_field('content_of_the_news'); ?>
  88. </div>
  89. <?php endwhile; endif; ?>
  90.  
  91.  
  92. <?php next_posts_link('Go to next page...'); ?>
  93. <?php posts_nav_link(); ?>
  94. <?php wp_pagenavi(); ?>
  95.  
  96. <?php $big = 999999999; echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $the_query->max_num_pages ) ); ?>
  97.  
  98. </div>
  99. </div>
  100.  
  101. <?php get_footer();?>
Advertisement
Add Comment
Please, Sign In to add comment