WordPress.org

Support

Support » Plugins and Hacks » [Resolved] How to access related posts content

[Resolved] How to access related posts content

  • alevalentini
    Participant

    @alevalentini

    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/

Viewing 1 replies (of 1 total)
  • alevalentini
    Participant

    @alevalentini

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] How to access related posts content’ is closed to new replies.