Support

Account

Home Forums Add-ons Options Page Repeater fields don\'t show on archive page

Solving

Repeater fields don\'t show on archive page

  • I have a similar problem as shown here: https://support.advancedcustomfields.com/forums/topic/option-field-value-not-loading-on-archive-page/ however I am using repeater fields in a shortcode, here is my code:

    function dev_logos_func( $atts ){ 
    	$devLogos = '<div id="logos">';
    	
    		while ( have_rows('development_logos','options') ) : the_row();
            
            	$devLogos .= '<a href="'.get_sub_field('dev_url','options').'" target="_blank">'.get_sub_field('dev_name','options').'</a><div class="logosTxt">'.get_sub_field('dev_text','options').'</div>';
                
            endwhile; 
    		
    	$devLogos .= '</div>';
    	
    	return $devLogos;
    }
    add_shortcode( 'dev_logos', 'dev_logos_func' );

    They show on every page except archive, and also categories.

    Some of my other fields where the same such as a image field however I was able to by pass that by doing a conditional statement like this:

    if (is_archive()) {
     	   $logoUrl = wp_get_attachment_url( get_field('logo', 'options') );
        } else {
            $logoUrl = get_field('logo', 'options');
        }

    However I am unsure what I can do for my repeater fields considering they are just text, url and textarea. I did find this: https://www.advancedcustomfields.com/resources/value-loading-posts-page/ however do not know how I can apply it to my issue.

    Any help would be greatly appreciated.

  • Hi @gab1982 ,

    That is quite odd as you are already providing the second parameter for the post ID in the loop.

    Have you tried using option as in the documentation as opposed to options.

    Kindly try it out and let me know how it goes.

  • Hi James,
    Yes I have, its exactly the same no change.

    thanks
    Graham

  • Hi @gab1982

    Thanks for the follow up.

    Kindly open a support ticket at [email protected] for more personalised support.

  • Hi James,
    Sorry for the long time to reply, I have now posted a ticket.

    thanks
    Graham

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Repeater fields don\'t show on archive page’ is closed to new replies.