links.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /*
  3. Template name: 友情链接
  4. description: template for yusi123.com Yusi theme
  5. */
  6. get_header();
  7. ?>
  8. <div class="pagewrapper clearfix">
  9. <aside class="pagesidebar">
  10. <ul class="pagesider-menu">
  11. <?php echo str_replace("</ul></div>", "", ereg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('theme_location' => 'pagemenu', 'echo' => false)) )); ?>
  12. </ul>
  13. </aside>
  14. <div class="pagecontent">
  15. <header class="pageheader clearfix">
  16. <h1 class="pull-left">
  17. <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
  18. </h1>
  19. <div class="pull-right">
  20. <?php deel_share() ?>
  21. </div>
  22. </header>
  23. <?php while (have_posts()) : the_post(); ?>
  24. <article class="article-content">
  25. <?php the_content(); ?>
  26. </article>
  27. <h2>友情链接</h2>
  28. <?php
  29. $bookmarks = get_bookmarks(array('category' => dopt('d_linkpage_cat')?dopt('d_linkpage_cat'):''));
  30. if ( !empty($bookmarks) ){
  31. echo '<ul class="link-content clearfix">';
  32. foreach ($bookmarks as $bookmark) {
  33. echo '<li><a href="' . $bookmark->link_url . '" title="' . $bookmark->link_description . '" target="_blank" >'. get_avatar($bookmark->link_notes,64) . '<span class="sitename">'. $bookmark->link_name .'</span></a></li>';
  34. }
  35. echo '</ul>';
  36. }
  37. ?>
  38. <h2>我的链接</h2>
  39. <?php
  40. $bookmarks = get_bookmarks(array('category' => dopt('d_linkpage_cat_mine')?dopt('d_linkpage_cat_mine'):''));
  41. if ( !empty($bookmarks) ){
  42. echo '<ul class="link-content clearfix">';
  43. foreach ($bookmarks as $bookmark) {
  44. echo '<li><a href="' . $bookmark->link_url . '" title="' . $bookmark->link_description . '" target="_blank" >'. get_avatar($bookmark->link_notes,64) . '<span class="sitename">'. $bookmark->link_name .'</span></a></li>';
  45. }
  46. echo '</ul>';
  47. }
  48. ?>
  49. <?php comments_template('', true); ?>
  50. <?php endwhile; ?>
  51. </div>
  52. </div>
  53. <?php get_footer(); ?>