WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
Querying children custom post types (2 posts)

  1. lukelukeluke
    Member
    Posted 1 year ago #

    I have a custom post type called "Club" I also have a child custom post type for Clubs called "Project"

    I want to display the children (Projects) on the single page of the parent (Club).

    At the moment, the query displays all children (Projects) on all of the Parents single pages (Clubs). Where am I going wrong?

    $args = array('child_of' => $post->ID;  'post_type' => 'project', 'posts_per_page' => 120 );
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();

    Thanks

    Luke

    http://wordpress.org/extend/plugins/types/

  2. mbigul
    Member
    Plugin Author

    Posted 1 year ago #

    Dear Luke,

    You can use types_child_posts for this purpose. Please check following URL for more details http://wp-types.com/documentation/user-guides/display-fields-table-content-using-views-or-the-types-api/ (Using the Types API) .

    [ Signature moderated. ]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic