Guest User

Untitled

a guest
Feb 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. array('exclude' => array( 1, 103 ),'parent' => '103','hide_empty' => true, )
  2.  
  3. <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
  4.  
  5. <h1 class="border-radius-5"><?php the_title(); ?></h1>
  6.  
  7. <div id="page" class="post-content">
  8.  
  9. <?php the_content(); ?>
  10.  
  11. <?php
  12. $terms = get_terms("category", $args);
  13. $count = count($terms);
  14. $categories = array(
  15.  
  16. );
  17.  
  18. if ($count > 0) {
  19.  
  20. echo '<ul class="listing-cat">';
  21.  
  22. foreach ($terms as $term) {
  23.  
  24. $args = array(
  25.  
  26.  
  27. 'post_type' => 'post',
  28. 'posts_per_page' => 1,
  29. 'show_count' => 1,
  30. 'orderby' => 'rand',
  31. 'post_status' => 'publish',
  32. 'tax_query' => array(
  33. array(
  34. 'taxonomy' => 'category',
  35.  
  36. 'field' => 'slug',
  37. 'terms' => $term->slug
  38. )
  39. )
  40. );
  41.  
  42. $video_from_categorie = new WP_Query( $args );
  43.  
  44. if( $video_from_categorie->have_posts() ){
  45.  
  46. $video_from_categorie->the_post();
  47.  
  48. }else{}
  49.  
  50. $term->slug;
  51. $term->name;
  52.  
  53. ?>
  54.  
  55. <li class="border-radius-5 box-shadow">
  56. <?php echo novavideo_get_post_image();?>
  57.  
  58. <a href="<?php echo get_category_link( get_cat_ID($term->name) ); ?>" title="<?php echo $term->name; ?>"><span><?php echo $term->name; ?></span></a>
  59.  
  60. <span class="nb_cat border-radius-5"><?php echo $term->count; ?> <?php if ( $term->count > 1 ){
  61. _e( 'videos', novavideo_get_theme_name() );
  62. }else{
  63. _e( 'video', novavideo_get_theme_name() );
  64. } ?></span>
  65. </li>
  66.  
  67. <?php
  68. }
  69. echo '</ul>';
  70. echo '<div class="clear"></div>';
  71. }
  72. ?>
  73.  
  74. </div><!-- #page -->
Add Comment
Please, Sign In to add comment