• 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>

    ";
    }
    }
    ?>

    Result gives something like this : https://frenchfragfactory.net/ozh/index.php?a=links

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Quick hack : list all links’ is closed to new replies.