Advertisement
Guest User

Untitled

a guest
May 6th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. <div class="tabbed">
  2.  
  3. <!-- tab 1 -->
  4. <div class="t1">
  5. <ul>
  6. <?php
  7. $count = 1;
  8. $tabbedSportsQuery = new WP_Query('cat='.get_query_var('cat').'&showposts=1');
  9. while ($tabbedSportsQuery->have_posts()) : $tabbedSportsQuery->the_post();
  10. echo '<div class="t'.$count.'">';
  11. echo the_post_thumbnail(array(665,500), array ('class' => 'alignnone'));
  12. $count++;
  13. endwhile;
  14.  
  15. ?>
  16.  
  17. </ul>
  18. </div>
  19.  
  20. <!-- tab 2 -->
  21. <div class="t2">
  22. <ul>
  23. <?php
  24. $count = 2;
  25. $tabbedSportsQuery = new WP_Query('cat='.get_query_var('cat').'&showposts=1');
  26. while ($tabbedSportsQuery->have_posts()) : $tabbedSportsQuery->the_post();
  27. echo '<div class="t'.$count.'">';
  28. echo the_post_thumbnail(array(665,500), array ('class' => 'alignnone'));
  29. $count = 2;
  30. endwhile;
  31.  
  32. ?>
  33.  
  34. </ul>
  35. </div>
  36.  
  37. <!-- tab 3 -->
  38. <div class="t3">
  39. <ul>
  40. <?php
  41. $count = 3;
  42. $tabbedSportsQuery = new WP_Query('cat='.get_query_var('cat').'&showposts=1');
  43. while ($tabbedSportsQuery->have_posts()) : $tabbedSportsQuery->the_post();
  44. echo '<div class="t'.$count.'">';
  45. echo the_post_thumbnail(array(665,500), array ('class' => 'alignnone'));
  46. $count++;
  47. endwhile;
  48.  
  49. ?>
  50.  
  51. </ul>
  52. </div>
  53.  
  54. <!-- The tabs -->
  55. <ul class="tabs">
  56. <li class="t1"><a class="t1 tab" ><h10><?php echo get_the_title($ID); ?></h10></a> </li>
  57. <li class="t2"><a class="t2 tab" ><h10><?php echo get_the_title($ID); ?></h10></a> </li>
  58. <li class="t3"><a class="t3 tab" ><h10><?php echo get_the_title($ID); ?></h10></a> </li>
  59. </ul>
  60.  
  61. </div><!-- tabbed -->
  62.  
  63. <?php
  64. $count = 1;
  65. $tabbedSportsQuery = new WP_Query(array(
  66. 'cat' => get_query_var('cat'),
  67. 'posts_per_page' => 3
  68. ));
  69.  
  70. while ($tabbedSportsQuery->have_posts()) : $tabbedSportsQuery->the_post();
  71. ?>
  72. <div class="t<?php echo $count?>">
  73. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(665,500), array ('class' => 'alignnone')); ?></a>
  74. </div>
  75. <?php
  76. $count++;
  77. endwhile;
  78. ?>
  79.  
  80. <!-- The tabs -->
  81. <ul class="tabs">
  82. <li class="t1"><a class="t1 tab" ><h10><?php echo get_the_title($ID); ?></h10></a> </li>
  83. <li class="t2"><a class="t2 tab" ><h10><?php echo get_the_title($ID); ?></h10></a> </li>
  84. <li class="t3"><a class="t3 tab" ><h10><?php echo get_the_title($ID); ?></h10></a> </li>
  85. </ul>
  86.  
  87. <?php
  88. $count = 1;
  89. $tabbedSportsQuery = new WP_Query(array(
  90. 'cat' => get_query_var('cat'),
  91. 'posts_per_page' => 3
  92. ));
  93. $out = '';
  94. while ($tabbedSportsQuery->have_posts()) : $tabbedSportsQuery->the_post();
  95. ?>
  96. <div class="t<?php echo $count?>">
  97. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(665,500), array ('class' => 'alignnone')); ?></a>
  98. </div>
  99. <?php
  100. if($count == 1) {
  101. $out .= '<ul class="tabs"><li class="t'.$count.'">';
  102. } else {
  103. $out .= '<li class="t'.$count.'">';
  104. }
  105. $out .= '<a class="t'.$count.' tab"><h10>'.get_the_title($ID).'</h10></a>';
  106. if($count == 3) {
  107. $out .= '</li></ul>';
  108. } else {
  109. $out .= '</li>';
  110. }
  111. ?>
  112. <?php
  113. $count++;
  114. endwhile;
  115. print $out;
  116. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement