Posted By

zartgesotten on 03/04/10


Tagged

wordpress links bookmarks custom


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrianCoyDesign


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
  2.  
  3. $links = $wpdb->get_results("SELECT * FROM $wpdb->links ORDER BY link_name ASC");
  4.  
  5. echo "<table border='0' class='linktable'>";
  6.  
  7. foreach ($links as $link) {
  8.  
  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;
  14.  
  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.