Posted By

zartgesotten on 03/04/10


wordpress links bookmarks custom

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Wordpress bookmarks custom

 / Published in: PHP

I didn't like the way my bookmarks came out with wplistbookmarks or any other built-in function, so I figured out a way to have total control about the way your wordpress bookmarks are displayed. In this example I wanted a table with the Bookmark-image in the left column and title and description in the right column.

  1. <?php
  3. $links = $wpdb->get_results("SELECT * FROM $wpdb->links ORDER BY link_name ASC");
  5. echo "<table border='0' class='linktable'>";
  7. foreach ($links as $link) {
  9. $linkurl=$link->link_url;
  10. $linkdesc=$link->link_description;
  11. $linkname=$link->link_name;
  12. $linkimage=$link->link_image;
  13. $linknotes=$link->link_notes;
  15. echo "<tr><td><a href='$linkurl' target='_blank'><img src='$linkimage' alt='$linkurl' border='0' class='linkimg'></a></td>";
  16. echo "<td valign='top' class='link-desc'><h5>$linkname</h5>";
  17. echo "<div class='link-description'>$linkdesc </div></td></tr>";
  18. }
  19. echo "</table>";
  20. ?>

Report this snippet  

You need to login to post a comment.