Posts 2 Posts
Connexions don't show (2 posts)

  1. tiwelle
    Posted 3 years ago #

    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


  2. tiwelle
    Posted 3 years ago #

    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...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic