[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/theme-compat/ -> sidebar.php (source)

   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  
  28              <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
  29              <li><h2><?php _e( 'Author' ); ?></h2>
  30              <p>A little something about you, the author. Nothing lengthy, just an overview.</p>
  31              </li>
  32              -->
  33  
  34                  <?php
  35                  if ( is_404() || is_category() || is_day() || is_month() ||
  36                  is_year() || is_search() || is_paged() ) :
  37                      ?>
  38              <li>
  39  
  40                      <?php if ( is_404() ) : /* If this is a 404 page */ ?>
  41              <?php elseif ( is_category() ) : /* If this is a category archive */ ?>
  42                  <p>
  43                  <?php
  44                      printf(
  45                          /* translators: %s: Category name. */
  46                          __( 'You are currently browsing the archives for the %s category.' ),
  47                          single_cat_title( '', false )
  48                      );
  49                  ?>
  50                  </p>
  51  
  52              <?php elseif ( is_day() ) : /* If this is a daily archive */ ?>
  53                  <p>
  54                  <?php
  55                      printf(
  56                          /* translators: 1: Site link, 2: Archive date. */
  57                          __( 'You are currently browsing the %1$s blog archives for the day %2$s.' ),
  58                          sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  59                          get_the_time( __( 'l, F jS, Y' ) )
  60                      );
  61                  ?>
  62                  </p>
  63  
  64              <?php elseif ( is_month() ) : /* If this is a monthly archive */ ?>
  65                  <p>
  66                  <?php
  67                      printf(
  68                          /* translators: 1: Site link, 2: Archive month. */
  69                          __( 'You are currently browsing the %1$s blog archives for %2$s.' ),
  70                          sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  71                          get_the_time( __( 'F, Y' ) )
  72                      );
  73                  ?>
  74                  </p>
  75  
  76              <?php elseif ( is_year() ) : /* If this is a yearly archive */ ?>
  77                  <p>
  78                  <?php
  79                      printf(
  80                          /* translators: 1: Site link, 2: Archive year. */
  81                          __( 'You are currently browsing the %1$s blog archives for the year %2$s.' ),
  82                          sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  83                          get_the_time( 'Y' )
  84                      );
  85                  ?>
  86                  </p>
  87  
  88              <?php elseif ( is_search() ) : /* If this is a search result */ ?>
  89                  <p>
  90                  <?php
  91                      printf(
  92                          /* translators: 1: Site link, 2: Search query. */
  93                          __( '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.' ),
  94                          sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
  95                          esc_html( get_search_query() )
  96                      );
  97                  ?>
  98                  </p>
  99  
 100              <?php elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) : /* If this set is paginated */ ?>
 101                  <p>
 102                  <?php
 103                      printf(
 104                          /* translators: %s: Site link. */
 105                          __( 'You are currently browsing the %s blog archives.' ),
 106                          sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) )
 107                      );
 108                  ?>
 109                  </p>
 110  
 111              <?php endif; ?>
 112  
 113              </li>
 114              <?php endif; ?>
 115          </ul>
 116          <ul role="navigation">
 117                  <?php wp_list_pages( 'title_li=<h2>' . __( 'Pages' ) . '</h2>' ); ?>
 118  
 119              <li><h2><?php _e( 'Archives' ); ?></h2>
 120                  <ul>
 121                  <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
 122                  </ul>
 123              </li>
 124  
 125                  <?php
 126                  wp_list_categories(
 127                      array(
 128                          'show_count' => 1,
 129                          'title_li'   => '<h2>' . __( 'Categories' ) . '</h2>',
 130                      )
 131                  );
 132                  ?>
 133          </ul>
 134          <ul>
 135                  <?php if ( is_home() || is_page() ) { /* If this is the frontpage */ ?>
 136                      <?php wp_list_bookmarks(); ?>
 137  
 138                  <li><h2><?php _e( 'Meta' ); ?></h2>
 139                  <ul>
 140                      <?php wp_register(); ?>
 141                      <li><?php wp_loginout(); ?></li>
 142                      <?php wp_meta(); ?>
 143                  </ul>
 144                  </li>
 145              <?php } ?>
 146  
 147              <?php endif; /* ! dynamic_sidebar() */ ?>
 148          </ul>
 149      </div>


Generated: Tue Mar 19 01:00:02 2024 Cross-referenced by PHPXref 0.7.1