• Hi,
    I’ve realized that the links of social icons opens in the same window. What can I do to make them open in a new window?

    Thank you.

    Regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hello famaca,

    => You have to edit widget-social-icons.php file located at wp-content/themes/hiero/inc/widgets/ directory.

    => Find below code


    a href="<?php echo $athemes_widgets_field_value; ?>" title="<?php echo $athemes_widgets_title; ?>">

    => And Replace with below code


    a href="<?php echo $athemes_widgets_field_value; ?>" title="<?php echo $athemes_widgets_title; ?>" onclick="window.open('<?php echo $athemes_widgets_field_value; ?>', 'newwindow', 'width=1024, height=800'); return false;" >

    Note : All Changes you done in widget-social-icons.php or other file are gone when you update theme. So prefer Child Theme

    Hope this will helps you.

    Thread Starter famaca

    (@famaca)

    Thank you for your answer it has been useful, although, in fact, what I wanted is not to open an independent window like a pup up but a new tab.

    Regards

    Hello @famaca,

    You can try to do this with jQuery.

    1. Install and activate Insert Headers and Footers plugin that will allow you to insert JavaScript (jQuery) code.

    2. Go to your DashboardSettingsInsert Headers and Footers → add the following code to Scripts in Header section, and click Save button.

    <script>
        jQuery(document).ready(function(){
            jQuery('.widget_athemes_social_icons ul li a').attr('target', '_blank');
        });
    </script>

    Kind Regards, Roman.

    Thread Starter famaca

    (@famaca)

    Thank you Roman for the suggestion.

    I thought that solving this problem was easier. Like adding, target=”_blank”, somewhere in the code.

    Regards

    Thread Starter famaca

    (@famaca)

    In the end, I’ve solved the problem in the easiest way. Adding: target=”_blank”>

    Great, you are welcome @famaca!

    Actually that code had to add target blank as well ??

    Kind Regards, Roman.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Link social icons another window’ is closed to new replies.