Also, here’s a copy of my functions.php in case that helps. https://gist.github.com/ameeker/383a74135c1cd9a1e34c
Version 4.4.3
I figured it out. My solution is below if anyone else wants to see it.
//* Add Past Officer Group Meta to Past Officers Page
add_action( 'genesis_entry_header', 'ogs_past_officers', 12 );
function ogs_past_officers($post_meta) {
if ( is_page ( 'past-officers' ) ) {
if( have_rows('add_past_officer_group') ):
while( have_rows('add_past_officer_group') ): the_row();
// vars
$term_years = get_sub_field('term_years');
$po_president = get_sub_field('po_president');
$po_vp = get_sub_field('po_vp');
$po_vp_1 = get_sub_field('po_vp_1');
$po_vp_2 = get_sub_field('po_vp_2');
$po_secretary = get_sub_field('po_secretary');
$po_treasurer = get_sub_field('po_treasurer');
echo '<p>';
if( $term_years):
echo '<b>Term Years:</b> ' . get_sub_field('term_years'). '';
endif;
if( $po_president ):
echo '<b>President:</b> ' . get_sub_field('po_president'). '';
endif;
if( $po_vp ):
echo '<b>Vice President:</b> ' . get_sub_field('po_vp'). '';
endif;
if( $po_vp_1 ):
echo '<b>1st Vice President:</b> ' . get_sub_field('po_vp_1'). '';
endif;
if( $po_vp_2 ):
echo '<b>2nd Vice President:</b> ' . get_sub_field('po_vp_2'). '';
endif;
if( $po_secretary ):
echo '<b>Secretary:</b> ' . get_sub_field('po_secretary'). '';
endif;
if( $po_treasurer ):
echo '<b>Treasurer:</b> ' . get_sub_field('po_treasurer'). '';
endif;
echo '</p>';
echo $content;
endwhile;
endif;
}}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.