Target Blank in php code

  • Unknown's avatar

    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>‘;
    }

    The blog I need help with is: (visible only to logged in users)

  • Hi @abbyandzeke, did you mean to post in the WordPress forums for the free software?
    https://wordpress.org/support/forums/

    These forums are specific to the sites using our managed service. We take care of maintenance, security, and support for the WordPress sites hosted on our servers, so if you’re interested, we have more information here:

    WordPress.com vs. WordPress.org

    Generally you won’t be able to edit PHP for sites on our servers, unless you’re working with your own custom theme on our Business or eCommerce plan. But if you are hosted here on our server, you can set your link targets from Customize > Menus.

  • Unknown's avatar

    Hi Supernovia,

    thanks so much for your assistance – it seems that wordpress.org was the place for me since that covers the third party hosting websites I’m after,

    Thanks! :)

  • The topic ‘Target Blank in php code’ is closed to new replies.