Advertisement
Guest User

Untitled

a guest
Aug 30th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. function add_dossier_to_person_page($content){
  4.  
  5. if(! is_singular('persons')) return $content;
  6.  
  7. $query = new WP_Query('post_type=cases');
  8.  
  9.  
  10. ob_start();
  11.  
  12. ?>
  13. <section id="person_dossier" class="cases-box">
  14. <div class="cases-box-header">
  15. <h1>Досье</h1>
  16. <hr>
  17. </div>
  18. <div class="cases-box-content">
  19. <?php
  20.  
  21. while ( $query->have_posts() ) : $query->the_post();
  22. the_title();
  23. //get_template_part( '/templates/parts/content' );
  24. endwhile;
  25. wp_reset_postdata();
  26. ?>
  27.  
  28. </div>
  29. </section>
  30.  
  31. <?php
  32.  
  33. $content .= ob_get_contents();
  34. ob_get_clean();
  35.  
  36. return $content;
  37. }
  38.  
  39. add_filter('the_content', 'add_dossier_to_person_page', 20);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement