• Resolved Francois Lamotte

    (@francoislamotte)


    Hello Scribu,

    In a template, I’m calling a sidebar template in which a declare the related WP_Query.

    However this is not the right way to do (or I am missing something) because I’ve got notices like :

    Notice: Undefined property: WP_Query::$ID

    Notice: Use of undefined constant xxxxx

    I’m building my queries like

    <?php echo get_post_meta($freemailing->ID, 'wpcf-mailingliste-description', true)?>

    or

    <?php $my_product_id = $freemailing->post->wpcf-mailingliste-id; ?>
    <input type=”hidden” name=”productId” value=”<?php $my_product_id ?>”>

    Any help would be appreciated 🙂

    http://wordpress.org/extend/plugins/posts-to-posts/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author scribu

    (@scribu)

    You didn’t post how you’re getting the $freemailing variable.

    Thread Starter Francois Lamotte

    (@francoislamotte)

    $freemailing = new WP_Query(array(
      'connected_type' => 'lecons_to_mailinglistes',
      'connected_items' => get_queried_object(),
      'nopaging' => true,
    ));

    Through the help of a partner, I found a way and It works now with queries like this one:

    <?php echo get_post_meta($freemailing->post->ID, 'wpcf-mail_teasing_video_titre1', true); ?>

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Posts 2 Posts] problem with get_sidebar’ is closed to new replies.