set_404(); include get_query_template('404'); exit; } $daohang = get_transient('gdk-daohang-html'); if (false === $daohang || empty($daohang)) { $daohang = gdk_create_html_daohang(); set_transient('gdk-daohang-html', $daohang); } $daohang; return; } return $template; } add_filter('template_include', 'gdk_daohang_html_api_handlers', 99); //导航单页函数 function gdk_get_the_link_items($id = null) { $bookmarks = get_bookmarks('orderby=date&category=' . $id); $output = ''; if (!empty($bookmarks)) { foreach ($bookmarks as $bookmark) {/* $bookmark->link_description */ $icon = $bookmark->link_image ?? 'https://img12.360buyimg.com/ddimg/jfs/t1/130599/4/13000/527/5f8ef17aE60de6b3e/4da08e59f8e12dec.png'; $output .= '
' . $bookmark->link_name . '
' . $bookmark->link_notes . '
'; } } return $output; } function gdk_get_link_items() { $linkid = gdk_link_id(); $linkcats = get_terms('link_category', 'orderby=count&hide_empty=1&exclude=' . $linkid ); $result = ''; foreach ($linkcats as $linkcat) { $result .= '
' . $linkcat->name . '
'; $result .= gdk_get_the_link_items($linkcat->term_id); $result .= '
'; } return $result; } function gdk_create_html_daohang() { ?> 网址导航 - <?php echo get_bloginfo('name'); ?>

'; foreach ($linkcats1 as $linkcat) { echo '
  • ' . $linkcat->name . '
  • '; } echo ''; echo '© ' . get_bloginfo('name') . '
    '; echo gdk_get_link_items(); ?>