Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function add_dossier_to_person_page($content){
- if(! is_singular('persons')) return $content;
- $query = new WP_Query('post_type=cases');
- ob_start();
- ?>
- <section id="person_dossier" class="cases-box">
- <div class="cases-box-header">
- <h1>Досье</h1>
- <hr>
- </div>
- <div class="cases-box-content">
- <?php
- while ( $query->have_posts() ) : $query->the_post();
- the_title();
- //get_template_part( '/templates/parts/content' );
- endwhile;
- wp_reset_postdata();
- ?>
- </div>
- </section>
- <?php
- $content .= ob_get_contents();
- ob_get_clean();
- return $content;
- }
- add_filter('the_content', 'add_dossier_to_person_page', 20);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement