Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter laura-work-in-progress

    (@laurafallofman)

    @bcworkz

    ha ha this advice is probably even better than the target-blank one, through my research on various questions I’ve seen a loooot of controversy. Anyhow, grateful for your help & good luck! ??

    Thread Starter laura-work-in-progress

    (@laurafallofman)

    Hi @bcworkz ,
    That’s great, thanks, works now, and yes – in the process of researching this subject “new window” option was much more strongly encouraged then “target blank” and was reading up on all the Pros and Cons on this. very controversial subject, as it appears ??

    But thanks for your help, much appreciated!

    Have a fab day,

    Laura

    Thread Starter laura-work-in-progress

    (@laurafallofman)

    @catacaustic

    I think I’ve located the actual code, I tried to define target “blank here, but no luck. If you’re able to advice, that would be wonderful, thanks

     if (!$type) {
            foreach ($items_array as $item) {
              $icon = $default_icons[$item['type']]['icon'];
              $html .= '<a href="' . esc_url($item['url']) . '" target=" '_blank' "><i class="' . esc_attr($icon) . '"></i></a>';
            }
    
            return $html;
          } elseif ($type == 'square') {
            foreach ($items_array as $item) {
              $icon = $square_icons[$item['type']]['icon'];
              $html .= '<a href="' . esc_url($item['url']) . '" target=" '_blank'"><i class="' . esc_attr($icon) . '"></i></a>';
            }
    
            return $html;
          } elseif ($type == 'with-title') {
            foreach ($items_array as $item) {
              $icon = $default_icons[$item['type']]['icon'];
              $title = $default_icons[$item['type']]['title'];
              $html .= '<a href="' . esc_url($item['url']) . '" target= " '_blank'"><i class="' . esc_attr($icon) . '"></i><span>' . strip_tags($title) . '</span></a>';
            }
    
            return $html;
          }
    Thread Starter laura-work-in-progress

    (@laurafallofman)

    hi @catacaustic

    Thanks for your response, I’ve found the location of each individual social link and wondering if the array could be wrapped into a link itself with target blank?

    here’s the code:

    if (!function_exists(‘pt_build_social_links’)) {
    function pt_build_social_links($type = false, $items = false) {
    $html = ”;
    $default_icons = array(
    ‘500px’ => array(
    ‘icon’ => ‘fab fa-500px’,
    ‘title’ => esc_html__(‘500px’, ‘unta’),
    ),
    ‘amazon’ => array(
    ‘icon’ => ‘fab fa-amazon’,
    ‘title’ => esc_html__(‘Amazon’, ‘unta’),
    ),
    ‘app-store’ => array(
    ‘icon’ => ‘fab fa-app-store’,
    ‘title’ => esc_html__(‘App Store’, ‘unta’),
    ),
    ‘behance’ => array(
    ‘icon’ => ‘fab fa-behance’,
    ‘title’ => esc_html__(‘Behance’, ‘unta’),
    ),

    Thread Starter laura-work-in-progress

    (@laurafallofman)

    @otto42

    in this scenario i do need it for my header social links since it takes you to a twitter.com or an instagram.com page. So here the impaction is that it leaves my site regardless. So thanks for the advice it won’t be relevant this time around ??

    Thread Starter laura-work-in-progress

    (@laurafallofman)

    @otto42 The requirement here is to open social media links in new window, therefore not leaving my website – so in this scenario it is required.

    Are there better ways to do it? happy to take on board some advice ??

    Thread Starter laura-work-in-progress

    (@laurafallofman)

    Thanks @catacaustic,

    This is the actual header code, I tried to add this command here but no luck either:

    
    if(pt_get_theme_setting('header_social_links') == 'true' && $social_links = pt_build_social_links()) {
      $header_social_links_html = '<div class="social-links">'.$social_links.'</div>';
    }
    

    Thanks for your time, much appreciated. I’ve been at this for hours (not a pro in coding as you can tell), but no luck

    • This reply was modified 4 years, 9 months ago by Marius L. J.. Reason: Fixed code block
Viewing 7 replies - 1 through 7 (of 7 total)