Advertisement
Guest User

Untitled

a guest
Jan 7th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 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. $args = array (
  21. 'post_type' => 'news',
  22. 'posts_per_page' => 2
  23. );
  24.  
  25. $the_query = new WP_Query( $args );
  26. ?>
  27.  
  28. <?php
  29. $posts =1;
  30. ?>
  31.  
  32. <div class="container news">
  33.  
  34. <div class="col-md-3">
  35.  
  36. <?php
  37. if ($posts == 1) {
  38. global $wp_query;
  39. $postid = $wp_query->post->ID;
  40. get_post_meta($postid, 'title_youtube_link', true);
  41. wp_reset_query();
  42.  
  43. echo '<h5>';
  44. echo the_field('title_youtube_link');
  45. echo'</h5>';
  46.  
  47. global $wp_query;
  48. $postid = $wp_query->post->ID;
  49. get_post_meta($postid, 'youtube_link', true);
  50. wp_reset_query();
  51.  
  52. $meta = get_post_meta(get_the_ID(), 'video', true);
  53. $content = apply_filters('the_content', get_field('youtube_link') );
  54. echo $content;
  55.  
  56. the_content();
  57. echo '<div style="padding-top: 35px;"></div>';
  58. dynamic_sidebar('news_taxonomy');
  59. echo '<div style="padding-bottom: 35px;"></div>';
  60. }
  61. $posts++; ?>
  62. </div>
  63. <div class=" col-md-8 col-md-offset-1">
  64.  
  65. <script>
  66. boxes = $('.news-height');
  67. minHeight = Math.min.apply(
  68. Math, boxes.map(function() {
  69. return $(this).height();
  70. }).get());
  71. boxes.height(minHeight);
  72. </script>
  73.  
  74. <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query -> the_post(); ?>
  75.  
  76. <div class=" news-style well" >
  77.  
  78. <a href="<?php the_permalink(); ?>"><h4 class="bold_this"><?php the_field('title_of_the_news'); ?>&rarr;</h4></a>
  79.  
  80. <ul class="info">
  81. <li>Posted in: <?php echo get_the_term_list( $post->ID, 'news_type','',','); ?> </li>
  82. <li>Added by: <a href="<?php bloginfo('siteurl') ;?>/about/"><?php the_author(); ?></a></li>
  83. <li>On: <?php the_time('F j, Y'); ?></li>
  84. </ul>
  85. <br><br>
  86. <?php the_field('content_of_the_news'); ?>
  87. </div>
  88. <?php endwhile; endif; ?>
  89.  
  90. <!-- posts_nav_link(' — ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); -->
  91. <?php wp_pagenavi(); ?>
  92.  
  93. </div>
  94. </div>
  95.  
  96. <?php get_footer();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement