Support

Account

Forum Replies Created

  • Ok, found the problem. I had to add the code in TWO placed within the theme template file….

    This was my final working code – if anyone finds this in a future search

    							/* START position for Advanced Custom Fields Content -- aka vendor-links */
    							$buttons = get_fields();
    							if( $buttons ) { 
    								echo
    									'<div class="button-strip et_pb_button_module_wrapper et_pb_button_3_tb_body_wrapper">';
    									foreach( $buttons as $but_name => $but_value ) {
    										if( !empty( $but_value ) ) { 
    											$but_label = get_field_object($but_name);
    											echo
    												'<a class="vendor-link3 ', $but_name ,'-button" title="',$but_label['label'] ,'" href="', $but_value ,'" target="_blank">', $but_label['label'] ,'</a>';
    										}
    									}
    								echo
    									'</div>';
    							}
    							/* FINISH position for Advanced Custom Fields Content -- aka vendor-links */
    

    I then used some CSS on “vendor-link3” and the button name (like amazon-button) to style them as buttons.

    Thanks for the pointers John.

  • ok, trying again. This doesn’t display empty buttons… but seems to not display anything at all.

    
    							$buttons = get_fields();
    							if( $buttons ) { 
    								echo
    									'<div class="et_pb_button_module_wrapper et_pb_button_3_tb_body_wrapper">';
    									foreach( $buttons as $but_name => $but_value ) {
    										if( !empty( $but_value ) ) { 
    											$but_label = get_field_object($but_name);
    											echo
    												'<a class="vendor-link" title="',$but_label['label'] ,'" href="', $but_value ,'">', $but_label['label'] ,'</a>';
    										}
    									}
    								echo
    									'</div>';
    							}
    

    Am I missing something obvious?

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