• Resolved EstherCoach

    (@esthercoach)


    Hi!

    Could you let me know the core file(s) where I can add the

    target=”_blank” attribute
    to the social icons on top and bottom sections?

    I would like them to open in a new tab rather than abandon mi clients site.

    Thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    For the top social icons, you would need to change in the header.php file:

    This:

    if(function_exists('icl_t')){
    																echo '<li><a href="'.esc_url( icl_t('Header Social Link',$llorix_one_social_icon->id.'_header_social_link',$llorix_one_social_icon->link) ).'"><i class="fa '.icl_t('Header Social Icon',$llorix_one_social_icon->id.'_header_social_icon',esc_attr($llorix_one_social_icon->icon_value)).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_social_icon->icon_value[2]).'</span></a></li>';
    															} else {
    																echo '<li><a href="'.esc_url($llorix_one_social_icon->link).'"><i class="fa '.esc_attr($llorix_one_social_icon->icon_value).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_social_icon->icon_value[2]).'</span></a></li>';
    															}

    to :

    if(function_exists('icl_t')){
    																echo '<li><a target="_blank" href="'.esc_url( icl_t('Header Social Link',$llorix_one_social_icon->id.'_header_social_link',$llorix_one_social_icon->link) ).'"><i class="fa '.icl_t('Header Social Icon',$llorix_one_social_icon->id.'_header_social_icon',esc_attr($llorix_one_social_icon->icon_value)).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_social_icon->icon_value[2]).'</span></a></li>';
    															} else {
    																echo '<li><a target="_blank" href="'.esc_url($llorix_one_social_icon->link).'"><i class="fa '.esc_attr($llorix_one_social_icon->icon_value).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_social_icon->icon_value[2]).'</span></a></li>';
    															}

    And for the footer icons you need to change footer.php from:

    if(function_exists('icl_t')){
    												echo '<li><a href="'.esc_url( icl_t('Footer Social Link',$llorix_one_lite_social_icon->id.'_footer_social_link', $llorix_one_lite_social_icon->link) ).'"><i class="fa llorix-one-lite-footer-icons '.icl_t('Footer Social Icon',$llorix_one_lite_social_icon->id.'_footer_social_icon',esc_attr($llorix_one_lite_social_icon->icon_value)).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_lite_social_icon->icon_value[2]).'</span></a></li>';
    											} else {
    												echo '<li><a href="'.esc_url($llorix_one_lite_social_icon->link).'"><i class="fa llorix-one-lite-footer-icons '.esc_attr($llorix_one_lite_social_icon->icon_value).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_lite_social_icon->icon_value[2]).'</span></a></li>';
    											}

    to:

    if(function_exists('icl_t')){
    												echo '<li><a target="_blank" href="'.esc_url( icl_t('Footer Social Link',$llorix_one_lite_social_icon->id.'_footer_social_link', $llorix_one_lite_social_icon->link) ).'"><i class="fa llorix-one-lite-footer-icons '.icl_t('Footer Social Icon',$llorix_one_lite_social_icon->id.'_footer_social_icon',esc_attr($llorix_one_lite_social_icon->icon_value)).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_lite_social_icon->icon_value[2]).'</span></a></li>';
    											} else {
    												echo '<li><a target="_blank" href="'.esc_url($llorix_one_lite_social_icon->link).'"><i class="fa llorix-one-lite-footer-icons '.esc_attr($llorix_one_lite_social_icon->icon_value).' transparent-text-dark" aria-hidden="true"></i><span class="screen-reader-text">'.esc_attr($llorix_one_lite_social_icon->icon_value[2]).'</span></a></li>';
    											}

    But please be aware that those changes will be overridden at a theme update. So, if you don’t want that, you could use a child theme, and make the changes in the child theme.

    Best regards,
    Rodica

    Thread Starter EstherCoach

    (@esthercoach)

    thanks!!

    Hi @esthercoach,

    I am really happy I was able to help you.
    If you are happy with our product and support, you can leave us a review here: https://wordpress.org/support/view/theme-reviews/llorix-one-lite.
    It would help us a lot 🙂

    Thank you,
    Rodica

    Thread Starter EstherCoach

    (@esthercoach)

    I think i already gave you a great review, but will check again just in case.
    🙂

    Thread Starter EstherCoach

    (@esthercoach)

    I had not! I´d have sweared I had but was mistaken.
    I have just done it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Social Icons Links Target – New tab’ is closed to new replies.