sidebar.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Theme_Compat
  5. * @deprecated 3.0.0
  6. *
  7. * This file is here for backward compatibility with old themes and will be removed in a future version.
  8. */
  9. _deprecated_file(
  10. /* translators: %s: Template name. */
  11. sprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),
  12. '3.0.0',
  13. null,
  14. /* translators: %s: Template name. */
  15. sprintf( __( 'Please include a %s template in your theme.' ), basename( __FILE__ ) )
  16. );
  17. ?>
  18. <div id="sidebar" role="complementary">
  19. <ul>
  20. <?php
  21. /* Widgetized sidebar, if you have the plugin installed. */
  22. if ( ! function_exists( 'dynamic_sidebar' ) || ! dynamic_sidebar() ) :
  23. ?>
  24. <li>
  25. <?php get_search_form(); ?>
  26. </li>
  27. <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
  28. <li><h2><?php _e( 'Author' ); ?></h2>
  29. <p>A little something about you, the author. Nothing lengthy, just an overview.</p>
  30. </li>
  31. -->
  32. <?php
  33. if ( is_404() || is_category() || is_day() || is_month() ||
  34. is_year() || is_search() || is_paged() ) :
  35. ?>
  36. <li>
  37. <?php if ( is_404() ) : /* If this is a 404 page */ ?>
  38. <?php elseif ( is_category() ) : /* If this is a category archive */ ?>
  39. <p>
  40. <?php
  41. printf(
  42. /* translators: %s: Category name. */
  43. __( 'You are currently browsing the archives for the %s category.' ),
  44. single_cat_title( '', false )
  45. );
  46. ?>
  47. </p>
  48. <?php elseif ( is_day() ) : /* If this is a daily archive */ ?>
  49. <p>
  50. <?php
  51. printf(
  52. /* translators: 1: Site link, 2: Archive date. */
  53. __( 'You are currently browsing the %1$s blog archives for the day %2$s.' ),
  54. sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  55. get_the_time( __( 'l, F jS, Y' ) )
  56. );
  57. ?>
  58. </p>
  59. <?php elseif ( is_month() ) : /* If this is a monthly archive */ ?>
  60. <p>
  61. <?php
  62. printf(
  63. /* translators: 1: Site link, 2: Archive month. */
  64. __( 'You are currently browsing the %1$s blog archives for %2$s.' ),
  65. sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  66. get_the_time( __( 'F, Y' ) )
  67. );
  68. ?>
  69. </p>
  70. <?php elseif ( is_year() ) : /* If this is a yearly archive */ ?>
  71. <p>
  72. <?php
  73. printf(
  74. /* translators: 1: Site link, 2: Archive year. */
  75. __( 'You are currently browsing the %1$s blog archives for the year %2$s.' ),
  76. sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  77. get_the_time( 'Y' )
  78. );
  79. ?>
  80. </p>
  81. <?php elseif ( is_search() ) : /* If this is a search result */ ?>
  82. <p>
  83. <?php
  84. printf(
  85. /* translators: 1: Site link, 2: Search query. */
  86. __( 'You have searched the %1$s blog archives for <strong>&#8216;%2$s&#8217;</strong>. If you are unable to find anything in these search results, you can try one of these links.' ),
  87. sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  88. esc_html( get_search_query() )
  89. );
  90. ?>
  91. </p>
  92. <?php elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) : /* If this set is paginated */ ?>
  93. <p>
  94. <?php
  95. printf(
  96. /* translators: %s: Site link. */
  97. __( 'You are currently browsing the %s blog archives.' ),
  98. sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) )
  99. );
  100. ?>
  101. </p>
  102. <?php endif; ?>
  103. </li>
  104. <?php endif; ?>
  105. </ul>
  106. <ul role="navigation">
  107. <?php wp_list_pages( 'title_li=<h2>' . __( 'Pages' ) . '</h2>' ); ?>
  108. <li><h2><?php _e( 'Archives' ); ?></h2>
  109. <ul>
  110. <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
  111. </ul>
  112. </li>
  113. <?php
  114. wp_list_categories(
  115. array(
  116. 'show_count' => 1,
  117. 'title_li' => '<h2>' . __( 'Categories' ) . '</h2>',
  118. )
  119. );
  120. ?>
  121. </ul>
  122. <ul>
  123. <?php if ( is_home() || is_page() ) { /* If this is the frontpage */ ?>
  124. <?php wp_list_bookmarks(); ?>
  125. <li><h2><?php _e( 'Meta' ); ?></h2>
  126. <ul>
  127. <?php wp_register(); ?>
  128. <li><?php wp_loginout(); ?></li>
  129. <?php wp_meta(); ?>
  130. </ul>
  131. </li>
  132. <?php } ?>
  133. <?php endif; /* ! dynamic_sidebar() */ ?>
  134. </ul>
  135. </div>