I have a list of clients with his telephones numbers and i call this custom type. I want change this whole numbers with images and not html numbers.
My actual code. Show in html 555 666 777 / 333 444 555
<?php global $wp_query; $postid = $wp_query->post->ID; $meta1 = get_post_meta($postid, 'telefono_2', true); ?>
<?php global $wp_query; $postid = $wp_query->post->ID; $meta = get_post_meta($postid, 'telefono_3', true);
$meta1 = preg_replace('/[^0-9]*/','', $meta1);
$meta1 =
substr($meta1, 0, 3) . ' ' . substr($meta1, 3, 3) . ' ' . substr($meta1, 6, 3);
echo $meta1;
if($meta != 0) {
$meta = preg_replace('/[^0-9]*/','', $meta);
$meta2 =
substr($meta, 0, 3) . ' ' . substr($meta, 3, 3) . ' ' . substr($meta, 6, 3);
echo " <span style='color:#EEEEEE !important;'>|</span> ".$meta2;
} ?>
I wish last three numbers for example was images 7.jpg but dynamic. It's possible? If not possible only last three, all the numbers is valid too.
Example final code output:
555 666 <img src="7.jpg" /><img src="7.jpg" /><img src="7.jpg" />