Support » Plugin: Posts 2 Posts » Connexions don't show

  • Hello,
    I’m trying to display the connection between books (product woocommerce post type) and authors (custom post type) on both authors and books page, but I can’t seem to male it work. Connection boxes appear on both admin pages, but impossible to get anything displayed on front end. I tried to put the WP_Query inside the loop, outside the loop, after a reset query tag… Please help ? My connection is called livres_auteur, and here is the code I’, trying to use on my books page.
    ` <?php
    // Find connected authors
    $connected = new WP_Query( array(
    ‘connected_type’ => ‘livres_auteur’, // the name of your connection type
    ‘connected_items’ => get_queried_object(),
    ‘nopaging’ => true,
    ) );

    // Display connected authors
    if ( $connected->have_posts() ) : ?>
    <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
    <li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    // Prevent weirdness

Viewing 1 replies (of 1 total)
  • FYI, connections are showing on auteur single.php, but not in my product-single.php
    It’s a mystery, I really don’t understand… Please help…

Viewing 1 replies (of 1 total)
  • The topic ‘Connexions don't show’ is closed to new replies.