Home Forums Add-ons Repeater Field Display repeater fields in child pages Reply To: Display repeater fields in child pages

  • Hi Jonathan, I still cannot get this working for some reason. the_permalink($postid); still displays the current page url instead of the parent.
    Sorry I’m no php expert, I’d appreciate if you could tell me what’s wrong. Here is the entire code of the actual template.

    Template Name: Page CEO Massage
    <?php get_header(); ?>
    	<section id="slider">
    		<div id="page-title-container">
    			<h1 id="page-title"><?php
    				echo empty( $post->post_parent ) ? get_the_title( $post->ID ) : get_the_title( $post->post_parent );
    	<section id="content">
    		<div id="col-lt">
    		global $post;
    			$postid = $post->post_parent;
    			$postid = $post->ID;
    		<?php if(get_field('content-container', $postid)): ?>
    			<?php while(has_sub_field('content-container', $postid)): ?>
    			<li><a href="<?php the_permalink($postid); ?>#<?php echo preg_replace('/[^A-Za-z0-9]/', "", get_sub_field('header')); ?>"><?php the_sub_field('header'); ?></a></li>
    			<?php endwhile; ?>
    		<?php endif; ?>
    		<div id="col-rt" class="top_no_padding">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    			<h2><?php the_title(); ?></h2>
    			<p><?php the_field('ceo_message'); ?></p>
    		<?php endwhile; endif; ?>
    <?php get_footer(); ?>