自定义Wordpress书签
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了自定义Wordpress书签相关的知识,希望对你有一定的参考价值。
I didn't like the way my bookmarks came out with wp_list_bookmarks 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.
<?php $links = $wpdb->get_results("SELECT * FROM $wpdb->links ORDER BY link_name ASC"); echo "<table border='0' class='linktable'>"; foreach ($links as $link) { $linkurl=$link->link_url; $linkdesc=$link->link_description; $linkname=$link->link_name; $linkimage=$link->link_image; $linknotes=$link->link_notes; echo "<tr><td><a href='$linkurl' target='_blank'><img src='$linkimage' alt='$linkurl' border='0' class='linkimg'></a></td>"; echo "<td valign='top' class='link-desc'><h5>$linkname</h5>"; echo "<div class='link-description'>$linkdesc </div></td></tr>"; } echo "</table>"; ?>
以上是关于自定义Wordpress书签的主要内容,如果未能解决你的问题,请参考以下文章
Wordpress - 将代码片段包含到布局的选定部分的插件