The proper way of using anchor links in wordpress
I’d battled for some time with attempting to puzzle out anchor methods in WordPress, nevertheless when it came to get into this matter, it had been essentially a scenario of including only a little HTML. Here is how you can get it carried out:
To start with, create all of the text inside your page, including where you’ll be connecting from (a listing of Frequently asked questions) for good examples and exactly where you will be connecting to (the anchor – some options for example). Bear in mind which you can use anchors to connect with another web page altogether, therefore the link need not be on the single web page simply because the anchor.
Create the anchor
After you have created all of your text, visit the place you want to place the anchor. This really is most likely some text, but could just like be easily a picture or other a part of your WordPress post. Making certain you are within the HTML editing part of your WYSIWYG editor, put your cursor before the text/image/code. Then, you will have to “mark” the created text, to ensure that the region from the anchor is specified. You want to do that by putting the next code in front of the text/code, altering the phrase label for nearly any string you select (this will be descriptive, or simply consecutive numbering):
< a>Text and/or code here…< /a>
Repeat this process for every part of the page that you want anchors, using a different label for each one.
Create the link
Since your anchor is within place, you are prepared to produce the hyperlink into it. This is accomplished using the href HTML tag. As a result, use relative or absolute links accordingly. The href tag syntax is composed such as this
< a rel=”nofollow” onclick=”javascript:_gaq.push(['_trackPageview', '/outgoing/article_exit_link/3248097']);” href=”URL you are linking to”>Text that will link to URL< /a>
Therefore, within this situation, you’ll produce a link similar to this, changing the right parts to ensure that it suits the application:
< a rel=”nofollow” onclick=”javascript:_gaq.push(['_trackPageview', '/outgoing/article_exit_link/3248097']);” href=”http://www.yourdomain.com/faqs/#label”>Text linking to anchor< /a>
When the link and also the anchor are on a single page however, use a relative URL, that involves removing everything between your first quotes (“) and also the hash symbol (#), departing a significantly simpler href:
< a rel=”nofollow” onclick=”javascript:_gaq.push(['_trackPageview', '/outgoing/article_exit_link/3248097']);” href=”#label”>Text linking to anchor< /a>