WordPress.org

Forums

Toolset Types
Querying children custom post types (2 posts)

  1. lukelukeluke
    Member
    Posted 2 years 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
    Posted 2 years 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

  • Toolset Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic