WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
Inherit custom fields (2 posts)

  1. Archie22is
    Member
    Posted 2 months 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 month 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.

Reply

You must log in to post.

About this Plugin

About this Topic