Support » Plugins and Hacks » Posts 2 Posts » [Plugin: Posts 2 Posts] 1.2 changes behavior of p2p_list_posts (with custom template)

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

    (@scribu)


    That’s a bug that was introduced along with the ‘separator’ parameter.

    Fixed in the development version (1.3-alpha).

    Thanks for reporting.

    Good to know! In the meantime I have resolved my problem by using a normal loop, as I needed to do some more complicated things with the output.

    Side question: using p2p_list_posts and a custom template, I wonder if it is possible inside the custom template to define variables, such as:

    $custom_title_var = get_the_title();
    $custom_url = get_permalink();

    and use them later in the loop for some conditional processing?

    When I try to do that, it doesn’t ouput anything, whereas using the_title() or the_permalink(); I obtain the expected values.

    Plugin Author scribu

    (@scribu)


    Those variables are reset on each iteration. You could make it work if you defined them as globals first, but I suggest you go with a plain loop instead of p2p_list_posts() in that case.

    Fine. Thanks for clarifying this!

    Plugin Author scribu

    (@scribu)


    I went ahead and removed the ‘template’ parameter since it required messing with the $post global, which was causing problems:

    http://wordpress.org/support/topic/plugin-posts-2-posts-custom-admin-boxes-example-mess-up-wp_query

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Posts 2 Posts] 1.2 changes behavior of p2p_list_posts (with custom template)’ is closed to new replies.