地狱十九重
努力开始新生活
用WP的友情链接功能做了个网络书签
2008-11-10 20:55 wordpress, 手机报, 收藏夹
在正在用的模板目录里写一个Favorites.php:
<?php /* Template Name: Favorites */ ?>
<?php get_header(); ?>
<!– content …………………………… –>
<div id=”Favorites”>
<?php
global $wpdb;
$links = $wpdb->get_results(“SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE taxonomy = \”link_category\” ” );
foreach ($links as $link) {
echo ‘<div class=”link”><h3>’;
$linknames = $wpdb->get_results(“SELECT name FROM $wpdb->terms WHERE term_id = $link->term_taxonomy_id ” );
foreach ($linknames as $linkname) {echo $linkname->name;}
echo ̵...