You can easily insert a menu or page title with external link on it but can you do the same on your site title or logo? If you don't know, you came to the right tutorial because by default, your logo link is your site address but we can easily modify that using JavaScript to do the trick.
This is a very short tutorial and straightforward. The topic is divided into two which is as follows:
Site Title as Text
Go to Weebly > Your Site > Settings > SEO > Footer Code and paste the following code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script> $("a:contains('Mine')").attr("href", "http://www.myweeblytricks.com/"); </script>
<script> $("a:contains('Mine')").attr("href", "http://www.myweeblytricks.com/"); </script>
Note:
Yellow text - This will be your website title. This is case sensitive so to avoid error, simply go to Settings > General > Site Title and you can see it there.
Green text - This will be the new link you will be pointing your site title.
Site Title as an Image or Logo
Go to Weebly > Your Site > Settings > SEO > Footer Code and paste the following code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>
$(document).ready(function() {
$(".wsite-logo a").attr("href", "http://www.myweeblytricks.com/");
});
</script>
<script>
$(document).ready(function() {
$(".wsite-logo a").attr("href", "http://www.myweeblytricks.com/");
});
</script>
Note:
Green text - Change with the new link you want to apply for your logo.
If you want to make your image/logo link open in a new tab, simply add the following script:
<script>
$(document).ready(function() {
$(".wsite-logo a[href^='http://']").attr("target","_blank");
});
</script>
$(document).ready(function() {
$(".wsite-logo a[href^='http://']").attr("target","_blank");
});
</script>
You're done!!! Easy right?
Subscribe to get more useful tutorials. Subscribing also gives you an access to the forum which one day can save dollars from you. The subscribe button is just below this post.
Great post! This is exactly what I was looking for!!!!! Now my subdomain logo redirects to my main page! Awesome! Thanks!
ReplyDeleteI did this and it worked thanks! BUT now on my website the page i link to is in the menu bar. How do i remove this?
ReplyDeleteGreat script!!! Wondering though if there is a way with two logos linking the home page and another image linking to a new page (_blank).
ReplyDelete