WordPress: too clever for its own documentation!
July 21st, 2010 by Sarah KingAny time you start using Widgets you forgo control and sometimes you need to take it back! A while ago I needed to control the sort orderĀ of the Links widget and found the “right way” to do it. Today, I needed it again but could I find the documentation anywhere?
In the end I found it at the bottom of a thread answered by Pinoy.ca.
All you need to do is find the functions.php file for your theme and add
function widget_links_args_filter($args) { $args['orderby'] = 'rating'; // Sort links by rating $args['order'] = 'DESC'; // descending return $args;}add_filter('widget_links_args','widget_links_args_filter');
Its easy to understand what you’re doing once you have that small example. A shame, I guess, that sort order isn’t able to be set in the widget itself but if you need to make the change this is so much safer than messing with the source code as some sites recommend.
widget_links_args – try searching on Google or WordPress.org, you won’t find any official documentation for this function. Crazy!
generic viagra gel tab Purchase Viagra best place to buy viagra
effects of viagra mixed with cocaine! Guaranteed Cheapest Viagra where can i get free viagra!
viagra for plants Natural Viagra Smode su viagra webrb int mc smoking viagra 431.
Viagra depression women viagra derivatives 471. Natural Viagra Substitutes viagra pre and post!
Tags: blogroll, links, sortorder, widgets, widget_links_args, wordpress
. Posted in WordPress | 1 Comment »
Categories
Recent Comments
Sign up for my occassional newsletter
Tags
adsense auckland blog blogger bmx cms crime digitalpoint directory dmoz domains email forum forums fraud google googlebot html images internet javascript joomla keywords kids kiwi link-vault Mambo / Joomla mtb nbo New Zealand odp phishing php property-investment rss scam seo serps sitemap spam submission vbulletin viral-marketing wordpress xml2. Essentials
3. Code Examples
4. Social Networking
5. Just for fun

