Quick hack : list all links
-
I plan to add a lots of links and categories, but I only display two random links for each category to avoid loooooooooong lists. As I didnt find any build-in way to list all links on a separate page (did I miss something ?) I wrote these few lines :
<?
$categories = $wpdb->get_results("SELECT cat_id, cat_name FROM $tablelinkcategories");
foreach ($categories as $category) {
$links = $wpdb->get_results("SELECT link_url, link_name FROM $tablelinks WHERE (link_category=$category->cat_id AND link_visible='Y')");
if ($links) {
print "<h3>$category->cat_name</h3>- " ;
- link_url."\">".$link->link_name."
foreach ($links as $link) {
print "";
//print $link->link_name;
}
print "";
}
}
?>
Result gives something like this : https://frenchfragfactory.net/ozh/index.php?a=links
- The topic ‘Quick hack : list all links’ is closed to new replies.