Home › Forums › Add-ons › Repeater Field › Styling subfields › Reply To: Styling subfields
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!
📣 “ACF Chat Fridays”
— Advanced Custom Fields (@wp_acf) January 31, 2023
The ACF team holds their first open office hours this Friday! Come and talk ACF, and ask questions about building sites with the plugin.
We’d love to see you there!
📆 Friday 3rd Feb - 3pm UTC
👉 Register here - https://t.co/3UtvQbE4CU pic.twitter.com/oTwW9K1XQ0
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.