Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <?php
- $connected = new WP_Query( array(
- 'connected_type' => 'projects_to_projects',
- 'connected_items' => get_queried_object(),
- 'nopaging' => true
- ) );
- echo 'This is where related posts should start displaying.<br />';
- // Display connected pages
- if ( $connected->have_posts() ) {
- echo 'I am inside the loop and I worked.';
- echo '<ul class="group">';
- while ( $connected->have_posts() ) : $connected->the_post();
- echo '<li><h3 class="project-title">' . $post->post_title . '</h3></li>';
- endwhile;
- echo '</ul>';
- // Prevent weirdness
- wp_reset_postdata();
- }
- echo 'This is where related posts should end displaying.<br />';
- //using custom dump function
- dump($connected);
- ?>
- <?php endwhile; endif; ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement