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

  1. alevalentini
    Posted 10 months 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)?


  2. alevalentini
    Posted 8 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.


You must log in to post.

About this Plugin

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

About this Topic