WordPress.org

Forums

Custom Content Type Manager
[resolved] How to access related posts content (2 posts)

  1. alevalentini
    Member
    Posted 1 year ago #

    I created a new content type called "Aggregate" used to publish a "block" of selected news in a news website.

    I gave this content type some custom fields, all related post fields. So I have "linktorel1", "linktorel2" and so on.

    In my template php files, how can I access the content of the posts that the author selected through the admin panel? Would it be wise to create a second nested query with the id of the post (in order to be able to use the whole wp functions package like the_ID(), the_category() and so on)?

    https://wordpress.org/plugins/custom-content-type-manager/

  2. alevalentini
    Member
    Posted 11 months ago #

    It was simple, really.

    Used `$custom_fields = get_post_custom();
    $my_custom_field = $custom_fields['my-custom-field-name'];` to get the id of the post and then used that id with the usual wordpress functions to get data.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Content Type Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic