Custom Field Template
PHP code not working inside the_content hook (6 posts)

  1. Wasee
    Posted 4 years ago #

    I tried both shortcodes and direct php to display custom fields inside the_content hook but no success

    For example my custom field was Display tried both methods but didn't work even tried to execute a simple php echo but that's also not working but i can confirm html and plain text is working fine inside the hook.


    if ( get_post_meta($post->ID, 'Display', true) ) {
    echo get_post_meta($post->ID, "Display", true);

    So any suggestion?

  2. html-css
    Posted 4 years ago #

    Facing same issue as Wasee mentioned so any available fix for this?

  3. html-css
    Posted 4 years ago #

    Hiroaki Miyashita any reply for this issue please?

  4. Hiroaki Miyashita
    Plugin Author

    Posted 4 years ago #

    Please add the following line before using $post.

    global $post;

    You can also use the cft shortcode.

    [cft key='Display']
  5. WayLay Design
    Posted 4 years ago #

  6. html-css
    Posted 4 years ago #

    Thanks Hiroaki Miyashita it works perfectly!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Field Template
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic