Wednesday, October 16, 2013

Simplify navigation with Back to Top

Certain sections of WordPress blogs can sometimes be very long; it is unnecessary scroll back to your visitor...

Much easier to navigate the visitor by offering a simple link "Back to Top" at the bottom of each of your pages.

Simplify navigation with Back to Top

Why A Link Back Up?

A typical example: The article is interesting, visitors continue reading and scroll to find more distance and lower and lower... And if want to return the top took it? He would lose a lot of time rescroller!

Here are some very simple ways to remedy this:
  • Add an anchor by hand in your header
  • Install a plugin that does it all alone!
1. Change Some Files

Above all, do not forget to make a backup of the files you going to change.
Add an anchor in the "header.php" file of your active theme. Via Appearance > Editor, edit the "header.php" file that you find in /wp-content/themes/your-theme/

Then find the closing </head> and the opening of the <body> after having found, copy the code below immediately after the opening of the <body>. Sometimes it contains settings and additional controls, if that were the case, make sure you add the anchor just after the end tag.

<a name="top"></a>
This should give you:

</head>
<body><a name="top"></a>
You can now save your "header" file and decide on where you will place the link "Back to the Top." Most often, this will be the end of each page/article, you must also change your "footer.php" file, but you could add anywhere (eg single.php or page.php).

The link must be pasted as follows:

< a href = "#top" >Back to top</ a >
This is already done! Once the file is saved, you will then see this link: "Back to Top" at the end of all your pages.

You could, of course, customize this advantage "Back" using an image/icon link to a "text" link, using a + href an image class (example: <a href = "#top" ><img class="Name-of-your-class" src="http://link-to-image.png" /></ a>), which will give you a picture like this: Back to top - Back to Top

With a bit of CSS, you could even customize advantage:

 #Name-of-your-class{
 z-index: 2;
 background: #FF8500 url(images/votre-image.png) no-repeat center;
 width: 30px;
 height: 30px;
 text-indent: -99999px;
 border-radius: 50px;
 -moz-border-radius: 50px;
 -webkit-border-radius: 50px;
 position: fixed;
 bottom: 10px;
 right: 10px;
 cursor: pointer;
 }
2. Using a Plugin Who Knows Make...

Dynamic-to-top plugin knows how to do and does it very well. It adds a dynamic and automatic icon "up" to facilitate the return to the top of your pages longer. Dynamic-to-top has a panel intuitive style to suit the specific needs of each site.
Note: The button appears only for browsers with javascript enabled and can optionally be disabled via the mobile visitors.

Dynamic-to-top

Dynamic-to-top 1

Dynamic-to-top 2


See more wordpress tutorial

Share it Please

0 comments:

Post a Comment

Copyright @ 2013 Johnny Gagnon blog. Designed by Templateism | Love for The Globe Press