Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  3. <?php wpb_set_post_views($post->ID);
  4.  
  5. $tags = get_the_tags();
  6. $term_ids=array();
  7. if($tags){
  8. foreach($tags as $tag) {
  9. array_push($term_ids,$tag->term_id);
  10. }
  11. }
  12.  
  13. $photos_id = get_cat_ID( 'photos' );
  14. $tv_id = get_cat_ID( 'tv-posts' );
  15. $music_videos_id = get_cat_ID( 'music-videos' );
  16.  
  17. if ( post_is_in_descendant_category($photos_id) || in_category('photos', $post->ID) ) {
  18. include(locate_template('partials/single_photo.php'));
  19. }
  20. elseif(post_is_in_descendant_category($tv_id) || in_category('tv-posts', $post->ID)){
  21. include(locate_template('partials/single_tv.php'));
  22. }
  23. elseif(in_category('music-videos', $post->ID) || post_is_in_descendant_category($music_videos_id)){
  24. include(locate_template('partials/single_music-video.php'));
  25. }
  26. else {
  27. include(locate_template('partials/single_post.php'));
  28. }
  29. ?>
  30.  
  31. <?php endwhile; endif; ?>
  32.  
  33. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement