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