Support

Account

Home Forums Front-end Issues Trying to add conditional display to blog-list Reply To: Trying to add conditional display to blog-list

  • 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.