Fake it until you make it! Style Tips and Fun with Fashion, over 40.

Wednesday, 9 August 2017

Easy Coding | Make a Blog Button Open in a New Window

Easy Coding | Making a Blog Button Open in a New Window.

We all love a blog link up party, don't we?
Linking up is a great way to discover new blogs, and find like-minded people to connect with.
It's inspirational, and great fun!

Once you have found a link up (or two) you like to be part of it's good manners (and just nice) to add the host's button to your post, or sidebar.

{See the bottom of my sidebar for some of the link-up buttons I have collected}

It's great to share other blogger's sites on your page BUT it can be a little frustrating when readers click on their button to take a look, and they are re-directed away from your page.
No one wants their reader to go away and (potentially) get 'lost' in someone else's content, maybe never to return!

It's MUCH better for the button to open another window in your browser, so your reader can visit and enjoy the other blogs as well as keeping your tab open.
Share and share alike!

Thankfully, not all blogger's buttons do this BUT, when they do, there is a simple solution.
No need to be frustrated, or hit delete!

There is a SUPER EASY way to make sure your reader stays with you, as well as opening other blog's page.
It's win win.

It just involves a (very) simple bit of coding.

Easy Coding | Making a Blog Button Open in a New Window.

Easy Coding | Changing a Blogger's Button so it opens in a New Window

When you have copied the button's code, and pasted it wherever you want it (in the body of your post, or in a widget) it's easy to check it over, and add the correct bit of code to make it open in a new window.
Simply add this piece of code in the correct place....

Insert the code target="_blank" just after the first url.

For example, this bit of code will redirect to the button's page, directly:

<a href="http://my fab blog.com/search/label/linkuppage"><img src="http://my fab blog's fab image/Link up logo.jpg" alt="Join the fun and link up!"/></a>

Whereas this code will open a new window:

<a href="http://my fab blog.com/search/label/linkuppage" target="_blank"><img src="http://my fab blog's fab image/Link up logo.jpg" alt="Join the fun and link up!"/></a>

Easy peasy!


Please let me know how you get on.
Happy linking and Happy Blogging!!
XXX
Easy Coding | Making a Blog Button Open in a New Window.

 P.S... If you want to know how to create a blog button check out THIS POST.... it's easy as pie too!

SHARE:

No comments

Post a Comment

Thank you for your comment.
I love reading your thoughts!
I try to reply to as many as I can so don't forget to tick the "notify me" box!

Blogger Template Created by pipdig