WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] Displaying connected posts doesn't show all related records (5 posts)

  1. panacorn
    Member
    Posted 2 years ago #

    Hi!

    I have installed this plugin v. 1.1.4 and it's perfect. But a little bit difficult in usage for non programmer.

    I inserted "Registering a connection type" php code from "Basic usage" page into my functions.php and "Displaying connected posts" php code into my single.php.

    It works correctly. But shows only 7 related records...

    I have to display ALL related records!

    Please, help me to solve this issue.

    BR,
    Evgueni

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

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    You just need to pass the 'nopaging' query var:

    $connected = new WP_Query( array(
      'connected_type' => 'YOUR_P2P_TYPE',
      'connected_items' => get_queried_object_id(),
      'nopaging' => true,
    ) );

    All query vars work, in fact: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters

  3. panacorn
    Member
    Posted 2 years ago #

    Thank you very much!!!
    All OK now...

  4. belinep
    Member
    Posted 2 years ago #

    All Query Vars? The 'orderby' => 'rand' variable doesn't seem to work... :-(

  5. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    @belinep: What does your connection type definition look like? And what parameters are you passing to WP_Query?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic