Adding a link to two websites in a widget

  • Unknown's avatar

    Hi, I’m trying to create a link to two different websites in a widget area and it’s not working for me. I tried to put this:

    click me

    and this

    ” onclick=”window.open(‘http://<link2>’,”,’width=700,height=700′);<add more>”>multiple window link`

    but nothing works.

    I’d appreciate your help.

    Thanks,
    Magda

    PS. I’m using the PENSCRATCH THEME.

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

  • Hi there. “onclick” is JavaScript, and we can’t use ANY JavaScript on WordPress.com. See here: https://en.support.wordpress.com/code/

    The only way you’ll be able to add those links is by using the plain html a-tag: https://en.support.wordpress.com/beginning-html/#adding-a-link

    If the issue is opening the link in a new tab, you add the target=_blank attribute to the opening a-tag:

    <a href="link_URL_here" target="_blank">

    If you want it to open in a pop-up window, that’s not possible here.

  • Unknown's avatar

    Hi kokkieh,

    thanks for your reply. I did this and it worked right away. My problem is that I would like to have two different websites open in two new tabs upon clicking on this one link. Is that possible in wordpress.com?

  • No, it’s not possible to open two different sites from one link. At least, not in plain HTML. The a-tag can only ever link to one URL at a time, and that’s the only tool we have here for adding links.

  • Unknown's avatar

    OK, thanks for letting me know kokkieh.

  • If I may, why is it necessary to open two windows from one link? If I were to click on a link and it started opening multiple windows my first reaction would be to suspect malware and I’ll close down my browser immediately, so I’m really wondering why you want to do this.

  • Unknown's avatar

    I’m a researcher and I post ads for positions in my lab. If the positions are different I want someone to click on one link (say: click here to read more) and I’d like all the pages where there are descriptions of these positions to open. The reason different ads are on different pages is that my host university creates these ads on separate pages. I hope this is clear enough.
    I don’t know if that’s ok but I was hoping you could help me with another problem. I posted it some time ago but got no replies. Sometimes I change the css style in the editor and the changes show up while I’m in the editor more, but when I save and exit they don’t show up anymore. For instance I’m trying to change the style of links on one page only and I’ putting:

    .page-id-334 .entry-content a {
    color: #870052;
    font-weight: bold;
    }

    and I see the changes I want but not after I save and open the website again. Any idea why?
    Thanks.

  • The reason different ads are on different pages is that my host university creates these ads on separate pages. I hope this is clear enough.

    Ah, okay. I’d still recommend you rather place multiple links and use your anchor text to indicate information can be found on more than one page. This is both from an accessibility perspective (opening in new tabs and multiple tabs can confound screen-reading software) as well as to avoid user-confusion as I described above.

    I see the changes I want but not after I save and open the website again. Any idea why?

    I assume you do have the Custom Design upgrade? I ask as it’s not possible to save CSS changes if you don’t have that upgrade.

    Can you please post in the CSS forum for help with this? I’m afraid I don’t know enough about CSS to answer this one for you: https://en.forums.wordpress.com/forum/css-customization#postform

  • Unknown's avatar

    I assume I have as I have been able to modify the css quite much. It’s only with certain changes that I’m not able to modify the css, even though I see the changes in the editor.

  • The people in the CSS forum should be able to help you with that. If no one has answered you after a day or two, add “modlook” to the tags in the forum. That will flag your thread for staff to follow up.

  • The topic ‘Adding a link to two websites in a widget’ is closed to new replies.