Links List In A WordPress Sidebar Text Widget
Creating a list of links in a WordPress text widget is not hard to do if you know a little bit about HTML coding. If you don’t have any HTML knowledge you can still create a list in a WordPress text widget too, if you know where to find the right code to copy. This WordPress guide will show you how to find and copy the code to match the other lists shown on your WordPress sidebar.
First lets just create a simple list, this can be done using simple HTML code. Remember WordPress sidebar text widgets can accept HTML, plain text or scripts. Below is an example of a list of links, your theme may have a style for this type of list in its sytlesheet. If it does it will pick up the style that matches your sidebar. If not you will just have a simple list. Notice the first and third links open in the same window, the second link will open the link in a new window by using target=”_blank in the URL . The names of the sites; “Site One Name”, “Site Two Name” and “Site Three Name” are the anchor text or what will be shown as the link to be clicked.
<ul>
<li><a href=”http://www.site1.com/”>Site One Name</a></li>
<li><a href=”http://www.site2.com/” target=”_blank”>Site Two Name</a></li>
<li><a href=”http://www.site3.com/”>Site Three Name</a></li>
</ul>
Here is a little trick you can use to find the same code to use to match an existing WordPress widget list. Depending on what browser you are using, you are using Firefox right? No? Well you should be. Anyway when you are looking at your WordPress blogs main page with Firefox click View then Page Source on the tool bar and the code for your current page will show. Internet Explorer is similar click View then Source. Now you will see the source code of your blog. Next look for the area where the sidebar begins which is usually something like this: <div class=”sidebar”>. Now look for the type of widget you want to copy for your new text widget.
In the case below I used the Archives widget class to generate my list of links to look exactly like the Archives widget. Pay close attention to the code to make sure you get all the appropriate opening and closings tags. And In this case I am showing where to change the name from Archives to Change The Title Of The Widget Here. Placing all of that code in the text area will eliminate the need to use a title for the text widget, this is taken care of using “widgettitle” class. Simply copy all the code from the widget found in the souce code and change the tilte of the widget, the URLs and the anchor text.
<li id=”archives” class=”widget widget_archives”><h2 class=”widgettitle”>Change The Title Of The Widget Here</h2>
<ul>
<ul><li><a href=”http://www.site1.com/”>Site One Name</a></li>
<li><a href=”http://www.site2.com/” target=”_blank”>Site Two Name</a></li>
<li><a href=”http://www.site3.com/”>Site Three Name</a></li></ul>
</li>
Remember it is very important to close all tags or you can really mess up the sidebar! You shouldn’t use the code here either, use the specific code from your current WordPress theme and it may need changed when changing themes. When you are done save your changes, check your blog and marvel at your handiwork! Remember if the girls don’t find you handsome they should at least find you handy!
If you liked this post, feel free to leave a comment that is relevant to the post or subscribe to the feed and get future articles delivered to your feed reader.
Sorry but due to the spamming of a few all comments are moderated and will appear when approved and all drive-by comments will be deleted!












Comments
Or you could get a plugin to do it all for you
Reply
[...] Links in a WordPress Sidebar Text Widget – This post by WordPress Max provides the code and explains how to create a sidebar text widget. [...]
Very nice Article .Really a useful one.
Thanks for it .
Reply
Thanks for this
Needed this yesterday lol
Reply
I really wanted to set something up like this for quite some time now!
Thanks a ton!
Reply
Hello, thank you very much of this article, well think to use a direct widget is one possibility too, or isnt?
Reply
Jeff Replied:
June 10th, 2009 at 6:16 pm
I’m not sure what kind of language you are using and don’t know what a direct widget is.
Reply
Leave a comment
Drive-By comments will be deleted! Like "Thanks for sharing", "Nice post", or any other text that doesn't contribute to the discussion. If you ask a very specific question about your particular WordPress theme's code, it will probably be deleted. I can fix your WordPress site but for a price. If you ask a question like "Why don't my blog work right", it will be deleted. If you ask a question about your WordPress site without a leaving a link to it, it will be deleted. The point is to ask questions and or comment on the the actual content of the post, and to please use some common sense. All comments are moderated. Thank you.