Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » [Plugin: Types – Custom Fields and Custom Post Types Management] Listing Related Custom Post TYpes

  • I am using this plugin to create a Project Management website.

    In the website every project has a set of “tasks” which are created as a new custom post type. In the admin I can add new tasks to any project. My problem is how I can show a list of the tasks titles or titles+content on my project posts?

    Every project also has a client, which is another custom post type. I need to show every project’s related client on the project post as well. How can I do that?

Viewing 7 replies - 1 through 7 (of 7 total)
  • While in the loop, use:
    $children = types_child_posts('tasks');

    All Types fields related to ‘tasks’ are placed in ‘fields’ property of each returned results. Loop over returned results and render what you like.

    You can also specify second parameter:
    $children = types_child_posts('tasks', 'numberposts=5');
    Second parameter are query args WP can use when getting posts.

    I used a PHP widget and placed this in the text area:
    <?php {$children=types_child_posts('task'); }?>
    But it did not work. Is there anything I miss here?

    By the way how can I go back to the parent post from the child custom post type page? Is there any PHP code for that?

    I think that code won’t work from widget.
    Only from post loop.

    Don’t understand question from last comment.
    Can you explain little more?

    This is what I meant:
    From every project you have a list of tasks. Every item in the list is linked to a specific taks, that is a child post for that project.
    My question is how I can have a link back to the parent project on every task page.

    Is there any shortcode for child posts or parent posts?

    #1 No, there is not yet any call to get parent post. But actually you can use WP func for that, something like:
    get_permalink(get_post_meta($post_id, '_wpcf_belongs_project_id', true));
    Where $post_id is child post ID.

    #2 There are no shortcodes, only functions for that in Types. Views have shortcodes for that.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Types – Custom Fields and Custom Post Types Management] Listing Related Custom Post TYpes’ is closed to new replies.