dyadica.net

Fun and Games in the Dyadic Sea

Posts Tagged ‘wp_list_bookmarks()’

permalink image comments image
Thursday, 17 January '08: Night Of The Broken Bookmarks

I do not know what happened last night. For some strange reason all bookmarks / blogroll related bits just disappeared from dyadica.net.

A little googling revealed this is not a sole occurrence but perhaps wordpress related…? However this morning everything is back as it should be and I cannot find any reference to the issue… WEIRD.

I should have bookmarked the relevant pages.

On the upside this event has forced me to fully update from the depreciated get_links() tag to the new (2.1) wp_list_bookmarks() tag in a vain attempt to get things working. Something which needed doing for a while anyway.

From memory my research last night ( Can’t create/write to file ‘#sql_eac_0.MYD’ (Errcode: 17) ) pointed to my database tmp file needing to be flushed, but now it will forever be a mystery.

Tags: , , , , ,
permalink image comments image
Monday, 5 November '07: Custom wp_list_bookmarks() Call

With the advent of wordpress 2.1 the get_links() and associated tags have been depreciated and replaced with the new wp_list_bookmarks() call.

However for dyadica.net I needed to be able to manipulate the returned link data a little more deeply than wp_list_bookmarks() allows e.g. the ability to be able to exclude by category.

Take a look at the following:

<?phpglobal $wpdb;
$terms = $wpdb->get_results(“SELECT term_taxonomy_id, taxonomy, term_id, count FROM $wpdb->term_taxonomy WHERE ‘link_category’ = taxonomy”);

foreach ( (array) $terms as $term ) {

$items = $wpdb->get_results(“SELECT name, term_id FROM $wpdb->terms WHERE term_id = $term->term_id”);

foreach ( (array) $items as $item ) {

$links = wp_list_bookmarks(“echo=0&title_li=0&show_images=0&categorize=0&category=”.$item->term_id);

if ($links) {

echo “<h3 class=’post-title’>”.$item->name.”</h3>”.”<br />”;

echo “<ul class=’ilist’>”;
echo $links;
echo “</ul>”;
}

}
}

?>

Above is a custom call to the wordpress database that acts as a wrapper for the wp_list_bookmarks() providing facility for additional filtering / functionality as required.

Read..

Tags: , , , , , ,

poll tags

css | xhtml | dyadica.net © admin 2010 | powered: wordpress | fuel: ps-wii-elite | top | sign-up