i need to split my company addresses so they appear on each line... For example on hidden link this should appear so that where the commas are thats a new line. I would like this to happen for all records.
Also how do i add a prefix icon before the telephone, email and website.......
I managed to do the easy bit and create the custom code called split_address by cannot see how to add this as a field or do i apply this to the existing multi field somehow?
However to be 100% sure how you are displaying the address, could you send me screenshot of the actual field on the backend as well as the template where you've added the address field ?
If you are using the types shortcode to display the address then you can use the shortcode above. If you are not then I would need to provide a guide on how you can still achieve this because the custom shortcode that I gave requires that the field is called using a shortcode.
Snippet "split_address" has been updated.
There was error when trying to re-run the snippet:Unexpected output of the code snippet: // Add Shortcode function wp_split_address( $atts ) { // Attributes $atts = shortcode_atts( array( 'address' => '', ), $atts ); $address = str_replace(',','',$atts['address']); return $address; } add_shortcode( 'wp_split_address', 'wp_split_address' );
I also am not sure how to add this into my layout in blocks.