• Resolved blissofbeing

    (@blissofbeing)


    I am trying to output a posts associations via the function call in a theme file.

    But:
    wp_plugin_associated_posts_pro::get_associated_posts($page_id);

    doesn’work. I am using the pro version. Please help.

    The exact code I am using to test is:

    $page_id = 68; //A known custom post type ID
    $w = wp_plugin_associated_posts_pro::get_associated_posts($page_id);
    print_r($w);

    http://wordpress.org/extend/plugins/post-page-association-plugin/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter blissofbeing

    (@blissofbeing)

    OK, I found the solution. Instead of trying to call the function directly I can just use the WP do_shortcode() function:

    echo do_shortcode('[associated-posts]');

    This works great in my theme file. Thanks for the great plugin, keep it up.

    Plugin Author Dennis

    (@dhoppe)

    As you already noticed the shortcode works fine… But if you realy need the Query Object you can access the plugin itself: (only in the pro version!):

    $page_id = 4;
    $posts_query = $GLOBALS['wp_plugin_associated_posts_pro']->get_associated_posts($page_id);
    Print_R ($posts_query);
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Post Page Associator]Pro version: get_associated_posts() doesn't work’ is closed to new replies.