1er commit
1er version
This commit is contained in:
127
sidebar.php
Normal file
127
sidebar.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* The Sidebar containing the primary and secondary widget areas.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<div id="primary" class="widget-area" role="complementary">
|
||||
<ul class="xoxo">
|
||||
|
||||
<li id="search" class="widget-container widget_search">
|
||||
<?php get_search_form(); ?>
|
||||
</li>
|
||||
|
||||
<li id="archives" class="widget-container">
|
||||
<h3 class="widget-title"><?php _e( 'Archives', 'twentyten-child' ); ?></h3>
|
||||
<ul>
|
||||
<?php wp_get_archives( 'type=monthly&limit=25' ); ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- ajout -->
|
||||
<?php if( is_single() ) { ?>
|
||||
<li id="archives" class="widget-container">
|
||||
<h3 class="widget-title"><?php _e( 'Recent Posts', 'twentyten-child' ); ?></h3>
|
||||
<ul>
|
||||
<?php
|
||||
$args = array( 'numberposts' => '5' );
|
||||
$recent_posts = wp_get_recent_posts( $args );
|
||||
foreach( $recent_posts as $recent ){
|
||||
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<!-- /ajout -->
|
||||
|
||||
<?php
|
||||
//git
|
||||
$args = array(
|
||||
'depth' => 0,
|
||||
'show_date' => '',
|
||||
'date_format' => get_option('date_format'),
|
||||
'child_of' => 0,
|
||||
'exclude' => '2,13,32,103',
|
||||
'include' => '',
|
||||
'title_li' => '',
|
||||
'echo' => 1,
|
||||
'authors' => '',
|
||||
'sort_column' => 'menu_order, post_title',
|
||||
'link_before' => '',
|
||||
'link_after' => '',
|
||||
'walker' => '' );
|
||||
|
||||
if( is_page() ) {
|
||||
?>
|
||||
<li id="pages" class="widget-container">
|
||||
<h3 class="widget-title"><?php _e( 'Pages', 'twentyten-child' ); ?></h3>
|
||||
<ul>
|
||||
<?php wp_list_pages($args); ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Pages à exclure: 103, 32, 2, 13 -->
|
||||
<?php if( is_home() && is_front_page() ) :?>
|
||||
|
||||
<?php
|
||||
if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
|
||||
|
||||
<?php endif; // end primary widget area ?>
|
||||
|
||||
|
||||
<!--li id="meta" class="widget-container">
|
||||
<h3 class="widget-title"><?php _e( 'Meta', 'twentyten' ); ?></h3>
|
||||
<ul>
|
||||
<?php wp_register(); ?>
|
||||
<li><?php wp_loginout(); ?></li>
|
||||
<?php wp_meta(); ?>
|
||||
</ul>
|
||||
</li-->
|
||||
<?php endif;?>
|
||||
|
||||
|
||||
</ul>
|
||||
</div><!-- #primary .widget-area -->
|
||||
|
||||
|
||||
<div id="secondary" class="widget-area" role="complementary">
|
||||
<ul class="xoxo">
|
||||
|
||||
<?php if( !is_home() && !is_front_page() ) { ?>
|
||||
<?php
|
||||
// A second sidebar for widgets, just because.
|
||||
if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
|
||||
|
||||
<?php dynamic_sidebar( 'secondary-widget-area' ); ?>
|
||||
|
||||
<?php endif;
|
||||
} ?>
|
||||
|
||||
|
||||
<?php //
|
||||
if (is_single()) { ?>
|
||||
<li id="meta" class="widget-container">
|
||||
<h3 class="widget-title"><?php _e( 'Meta', 'twentyten-child' ); ?></h3>
|
||||
<ul>
|
||||
<?php wp_register(); ?>
|
||||
<!--li><?php wp_loginout(); ?></li-->
|
||||
<?php wp_meta(); ?>
|
||||
<li><?php comments_rss_link(__('RSS','twentyten-child')) ?></li>
|
||||
<li><a href="<?php trackback_url(true); ?>" rel="trackback"><?php _e('Trackback','twentyten-child')?></a></li>
|
||||
<?php if(function_exists('wp_print')) { ?>
|
||||
<li><?php print_link(__('Print This Post','twentyten-child'), __('Print This Page','twentyten-child')); ?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div><!-- #secondary .widget-area -->
|
||||
Reference in New Issue
Block a user