WordPress.org

Forums

Advanced Custom Fields
Inherit custom fields (2 posts)

  1. Archie22is
    Member
    Posted 1 year ago #

    Hi,

    How do I inherit advanced custom fields from a page into a a custom single page template?

    I have tried:
    <img class="page-image" src="<?php the_field('page_image'); ?>" />

    and

    <?php $color = get_post_meta($post->post_parent, 'page_image', true);
    		echo $color;
    
    		var_dump($color);
    		?>

    the var_dump returns bolean false.

    any ideas?

    https://wordpress.org/plugins/advanced-custom-fields/

  2. domokun
    Member
    Posted 1 year ago #

    I think Im right in saying that the Fields are added to a certain Post Type.

    As Page and your Custom Post Type are two different Post Types, your field will only show on Page.

    Edit the Field and look for the Location box. Add your second Post Type and it should start to show.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic