WordPress count your blogroll links

If you want to display total number of blogroll links you have? Then following code will be used to display the number of blogroll links.

$numlinks = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'");
if (0 < $numlinks) $numlinks = number_format($numlinks);
echo $numlinks;

Jeff Star

Leave a Reply

Your email address will not be published. Required fields are marked *