Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Matt Gibbs

    (@mgibbs189)

    Yes – definitely possible

    $cfs->get( false, $post->page_parent );

    Thread Starter AlexxelA

    (@alexxela)

    Thats nice 😀
    But how does it work exactly. Lets say there is a value called ‘foo’.
    The normal way would be:
    <?php echo cfs->get('foo') ?>
    Is it just like:
    $cfs->get( false, $post->page_parent, 'foo' );
    Because I just get ‘Array’ if I do this.
    And is there a way to get the page-ancestor? In case of an menu with 3 levels. Sth. like the ‘page_grandpa’? 😀

    Austin

    (@austinpickett)

    Just had this problem encountered and found out the solution.

    If you look at the documentation for $cfs->get() you will see the parameters are:

    $cfs->get($field_name, $post_id, $options);

    Furthermore if you look at the elements in the $post array you will not find a page_parent, but instead a post_parent

    Putting all of this together you should have something like this:

    <?php $cfs->get('foo', $post->post_parent); ?>

    Hopefully this works for you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get field valuse from a parent page’ is closed to new replies.