wordpress 友情链接分类显示代码
内容预览
wordpress分类显示友情链接,更加有好的现实友情链接,效果见本站右侧
wordpress分类显示友情链接,更加有好的现实友情链接,效果见本站右侧
1 2 3 4 5 6 7 8 9 10 | <?php $linkcats = $wpdb->get_results("SELECT T1.name AS name FROM $wpdb->terms T1, $wpdb->term_taxonomy T2 WHERE T1.term_id = T2.term_id AND T2.taxonomy = 'link_category'"); if($linkcats) : foreach($linkcats as $linkcat) : ?> <div class="boxcaption"> <h3><?php echo $linkcat->name; ?></h3> </div> <div class="box linkcat"> <ul> <?php $bookmarks = get_bookmarks('orderby=rand&category_name=' . $linkcat->name); if ( !empty($bookmarks) ) { foreach ($bookmarks as $bookmark) { echo '<li><a href="' . $bookmark->link_url . '" title="' . $bookmark->link_description . '" target="_blank" >' . $bookmark->link_name . '</a></li>'; } } ?> </ul> <div class="fixed"></div> </div> <?php endforeach; endif; ?> |