Display custom field in Post's content

Viewing 2 posts - 1 through 2 (of 2 total)
  • #20823
    annulixi
    Participant

    Hey,

    I am using Enlightenment theme for my project and I can’t figure out how to display custom fields that I have created for a Post? I am using a child theme for all my changes. I know what line in enlightenment/core/content.php I have to modify in order to display custom fields in the place I want. But as I can’t modify it right in enlightenment theme due to updates, I’d like to add this file to my child theme and modify it there. But I don’t know how to make it work. Could you help me please?
    It’s not working when I just copy /core/content.php into my child theme and modify it there.

    Cheers

    #20920
    Daniel Tara
    Keymaster

    The best way to do this is to create a shortcode that displays that custom field. This way you can control where the field appears in the content. See the Shortcode API documentation.

    If you don’t want to use a shortcode then you can use 'the_content' filter to append the field to the post content.

Viewing 2 posts - 1 through 2 (of 2 total)

Tagged: 

You must be logged in to reply to this topic.