Socials icons to open the link in new window/ tab?

Discussion in 'Andrina WordPress Theme' started by deveshd, Apr 27, 2013.

  1. deveshd

    deveshd Member

    Joined:
    Jul 21, 2012
    Messages:
    282
    Likes Received:
    4
    Screen shot 2013-04-26 at 9.52.20 PM.png

    ---------------------------------

    Hi Deveshd,

    The link below is to an excellent article explaining the benefits of a child theme.
    http://www.inkthemes.com/httpwww-inkthemes-comhow-to-create-a-child-theme-in-wordpress-a-way-to-save-themes-modification/02/

    If you like I can walk you through the steps in more detail if you want to give it a try.

    I started off modifying the parent files directly, but then made quite a few customizations and fixes that it quickly became very time consuming after a theme update. It is said that the best practice is to create a child theme if you need to make any changes to theme files. From my personal experience, I would say if this is the only change you are needing to make to the actual code in the files, it would be OK to just make the changes directly. Just keep in mind that each time you update the theme, you will need to test and make sure the functionality is still there. If any changes have been made by the theme developers to header.php file, your changes will be overwritten, so you may have to make your changes again.

    Good luck to you.
     
  2. Harmeet

    Harmeet Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    360
    Likes Received:
    15
    Hello,

    Put the following code after adding your link in the text field, it will open the link in new page.

    Code:
    target="_blank"
    For example http://www.inkthemes.com target="_blank"

    this will solve your problem.
     
  3. deveshd

    deveshd Member

    Joined:
    Jul 21, 2012
    Messages:
    282
    Likes Received:
    4
    Thanks Harmeet, but I'm not sure why it's still opening the links in same window... Please help. See screenshot below
    Screen shot 2013-04-27 at 11.23.25 AM.png

    PS: I tried clearing cache etc as well.
     
  4. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello Deveshd,
    In the above replied code, double inverted comma is missing by mistake.
    So, Put the following code after adding your link in the text field, it will open the link in new page.
    Code:
    "target="_blank"
    For example http://www.inkthemes.com "target="_blank"
    This will solve your issue.
     
  5. deveshd

    deveshd Member

    Joined:
    Jul 21, 2012
    Messages:
    282
    Likes Received:
    4
    Doesn't work :( It saves only for one visit. if you close and open the site again the target blank portion is gone... the theme is not saving the links that way... Please help
     
  6. deveshd

    deveshd Member

    Joined:
    Jul 21, 2012
    Messages:
    282
    Likes Received:
    4
    Please help me with this issue.
     
  7. sandymcdonald

    sandymcdonald Member

    Joined:
    May 29, 2013
    Messages:
    100
    Likes Received:
    1
    For some reason, I am having a problem when I put HTML code in the email address field in the home page settings. It works for a few times and then is cleared.

    To correct your problem, an option is to create a child theme and include a modified header.php. This is what I did because I needed social icons that are not provided. I went ahead and open all in a separate window. Do you already have a child theme in place? Let me know if you decide to go with this approach and need further help.
     
  8. deveshd

    deveshd Member

    Joined:
    Jul 21, 2012
    Messages:
    282
    Likes Received:
    4
    Hi Sandy: Thanks for the message. I'm not too technical so typically just copy-paste links or CSS is what I'm limited too. How difficult is it to create a child theme & modify the header? My only goal is to open the social icons in a new page/window/tab and nothing else. Please advise.
     
  9. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello Deveshd,
    Go to the header.php file present in your Theme directory and paste the given below in that file as shown in the image given below.
    Code:
    target="_blank">
    See the image for reference.
    [​IMG]

    This will solve your issue.
     
  10. sandymcdonald

    sandymcdonald Member

    Joined:
    May 29, 2013
    Messages:
    100
    Likes Received:
    1
    Hi Deveshd,

    The link below is to an excellent article explaining the benefits of a child theme.
    http://www.inkthemes.com/httpwww-inkthemes-comhow-to-create-a-child-theme-in-wordpress-a-way-to-save-themes-modification/02/

    If you like I can walk you through the steps in more detail if you want to give it a try.

    I started off modifying the parent files directly, but then made quite a few customizations and fixes that it quickly became very time consuming after a theme update. It is said that the best practice is to create a child theme if you need to make any changes to theme files. From my personal experience, I would say if this is the only change you are needing to make to the actual code in the files, it would be OK to just make the changes directly. Just keep in mind that each time you update the theme, you will need to test and make sure the functionality is still there. If any changes have been made by the theme developers to header.php file, your changes will be overwritten, so you may have to make your changes again.

    Good luck to you.
     
    deveshd likes this.

Share This Page