If I had to point out one page in WordPress admin area that gets least attention and coverage that would probably be Links.
I don’t know how Links were envisioned or started, but when I first started using WordPress they seemed nothing more significant than minor tool to set up your blogroll. It might seem that they stuck like that, but in reality they had really moved on in functionality.
What Links are
Link are (by definition) URLs to something, but they can also store additional data, such as:
- description;
- category;
- XFN relation;
- associated image;
- associated RSS feed address.
It is no longer just a link, it is link to something, link that looks like something and link that comes with meta information.
Access by code
Links have their own function ,somewhat inconsistently named wp_list_bookmarks().
It accepts multiple options and allows to control:
- which links are returned;
- should they be split by categories;
- how are they sorted;
- what markup are they surrounded with.
Access by widget
Since writing code is overkill for many WordPress users, widget is much more convenient way. Native Links widget kinda works, but lacks in functionality.
I highly recommend to go for Bookmarks widget instead, which is available as part of Hybrid theme or separately in Widgets Reloaded plugin.
It allows to control output precisely and completely in graphical interface.
Example usage
I want to write some solid advertisement management for upcoming (almost done, honestly) new theme. It struck me that for some parts Links will do just fine. Essentially advertisement is image and link.
Took me minutes to create several links, add images and use Bookmarks widget to output them (randomly sorted for kicks).
Not a single line of PHP code, barely two lines of CSS to float images. And yes – they will probably be smaller for release. :)
Overall
There are many possible applications for Links – from advertisement to supplementary navigation. They are simple, flexible, easy to work with without writing code.
You only have to know they are there. Now you do. :)
donace #
Rarst #
Edward de Leau #
donace #
Rarst #
Edward de Leau #
Rarst #
axel@id meneo #