How to work with lists of links, part 2

This next technique is simple, builds on a concept we stepped through in our previous article “Build a List of Links“, and involves possibly your first experience with a common under-the-hood convention in WordPress called a ‘shortcode’. In our previous How-to article we explained how to build and display a list of links as a widget — but what if you want to put that list of links into the main content area of a page of your site?

Many slightly more complex displays of certain types of content — like the links-on-a-page listing we’re aiming for — need a helper plugin to allow the fine control needed over specifying how that content displays. Shortcodes are the way you, the regular citizen, convey your wishes to the plugin. Ready?

You’ll start by building another Links category (or use the same Links category you used for your widgetized links list; if you create a new one, same instructions apply). Once that’s done, create a new page (‘Business Connections’ or whatever title describes these links.)

Begin with as much narrative as you wish to set up your list of links. Once you’re ready for the links, type in the following shortcode below your introductory text:

[links category_name="YourLinkCategoryName"]    
(you'll need to substitute the actual category name you defined)

Shortcodes in WordPress will always be formatted in a similar fashion to this one — surrounded on each end by brackets, and stating the plugin name first, followed by various values you want to pass to the plugin: [somepluginname variable1=”somevalue” variable2=”somevalue” ]

Once you save this new page, simply add it to your menu as you would any other page. There is also a ‘Links Shortcode’ screen, under Settings, where you can control defaults of how your links list displays — which fields are included or not, whether links display as a bulleted list, whether you want to display a facebook ‘like’ link as part of the link listing, etc. You may be perfectly content with the settings as-is right out of the box though.

For your reference, here is the plugin’s FAQ guide to exerting as much control over your links output on page as you’d like:

Posted in How-to Articles, Intermediate and tagged , .