Linking to other website (within a plugin)

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

26-Aug-17 14:18
Hi guys,

I'm quite new to this so I have no idea if this is a really silly question (sorry if it is!).

I set up an event calendar on this page: http://okconnection.world/construction/book-a-date/

using this plugin:
https://wordpress.org/plugins/event-clndr/

The plugin is working great. On the website where I set up the event calendar, the events are listed on the side next to the calendar. When you click on any of those events, it takes you to a link which you can add when editing an event. However, the link always takes you to a link within your own website, it always links to e.g. http://okconnection.world/construction/www.facebook.com instead of just going to www.facebook.com. I have no idea how to change this.

The form where you can add the event link doesn't allow any code, so that's something I already tried.

I looked inside the coding of the plugin and I found this line:
<% if (event.url) { %><a target="<%= event.url_target %>" href="<%= event.url %>" <% } else { %><div <% } %>

Of course, I have no idea what any of this does or means, but maybe the trick is to change something in here.

I would love to hear your ideas on this! Thanks in advance for your time

Kind regards,
Selma

[Edited by selmaporobic on 26-Aug-17 13:18]
26-Aug-17 18:17
The links are missing the protocol (http://) so browsers will normalise it to being 'internal'

so this


href="<%= event.url %>" <% }


should be



href=http://"<%= event.url %>" <% } else { %><div <% } %>


--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/
26-Aug-17 21:22
Hi Chris,

Thanks for your reply!

At first it didn't work, but then I deleted the " in your code and it worked!! Great!


href=http://<%= event.url %> <% }


This above is what I used now instead of this:


href="<%=event.url %>" <% }


Thanks a lot again

 
New posts
Old posts

Follow Elated