In the admin side everything seems to be good.
But I just can’t seem to get things to display.
This is the query on the page.
<?php global $post; $args = array( 'numberposts' => 1, 'post_type' => 'news', 'category_name' => 'sotm', 'post_status' => 'publish' ); $homeSOTMArticle = get_posts( $args ); foreach( $homeSOTMArticle as $post ) : setup_postdata($post); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <p><?php the_date('F Y'); ?></p> <p><?php the_excerpt(); ?></p> <?php endforeach; ?> <?php // Reset Post Data wp_reset_postdata(); ?>
The name I used when I registered the connection in functions.php was ‘news_to_suppliers’, I grabbed the code from the basic usage page for displaying connected posts, dropped in ‘news_to_suppliers’. Nothing happens when I do this.
Any insight is greatly appreciated.
- The topic ‘[Plugin: Posts 2 Posts] Can't display connected posts, Am I doing this correct?’ is closed to new replies.