add target”_blank” to PHP code
-
Hi there,
I’m using a theme where social links are predefined, however when set as “target=’_blank’” It does not work. I’ve located the source PHP code in the theme but my ability to modify it to my needs and introduce “Target=’_blank’” function are limited.
Please help to modify this code: and introduce “target”blank function for all instances.
Thanks, greatly appreciated.
if (!$type) { foreach ($items_array as $item) { $icon = $default_icons[$item[‘type’]][‘icon’]; $html .= ‘<i class=”‘ . esc_attr($icon) . ‘”></i>‘; } return $html; } elseif ($type == ‘square’) { foreach ($items_array as $item) { $icon = $square_icons[$item[‘type’]][‘icon’]; $html .= ‘<i class=”‘ . esc_attr($icon) . ‘”></i>‘; } return $html; } elseif ($type == ‘with-title’) { foreach ($items_array as $item) { $icon = $default_icons[$item[‘type’]][‘icon’]; $title = $default_icons[$item[‘type’]][‘title’]; $html .= ‘<i class=”‘ . esc_attr($icon) . ‘”></i><span>’ . strip_tags($title) . ‘</span>‘; }
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘add target”_blank” to PHP code’ is closed to new replies.