/ Published in: PHP
Images into your themes images folder, if different then change the path in while loop
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function my_follows(){ $social = 'http://www.facebook.com/your-name|facebook.png,http://www.youtube.com/your-name|youtube.png,..whatever u like..,END'; $data = explode(',', $social, -1); $my_follow_o = '<ul id="my_follows">'; $i=0; while($i < count($data)){ $pair = explode('|', $data[$i], 2); $my_img = '<img src="'.base_path().'sites/all/themes/your-theme-name/images/'.$pair[1].'" />'; $my_follow_o .= '<li>'.l($my_img, $pair[0], array('html' => 'true')).'</li>'; $i++; } $my_follow_o .= '</ul>'; return $my_follow_o; } anywhere you like <?php print my_follows(); ?> to print out the links... here's the CSS: ul#my_follows{ padding-left: 0 ! important; overflow: hidden; text-align: center; } #my_follows li{ display: inline; list-style: none; margin-right: 9px; } ul#my_follows > li:last-child{ margin-right: 0px; }