Ticket #1070: rosetta_dynamic_sidebar.patch
File rosetta_dynamic_sidebar.patch, 2.3 KB (added by , 10 years ago) |
---|
-
functions.php
32 32 } 33 33 add_action( 'after_setup_theme', 'rosetta_after_setup_theme' ); 34 34 35 35 36 /** 37 * Set the sidebar widget aries 38 */ 39 function rosetta_sidebars() { 40 41 // Blog 42 $args = array( 43 'id' => 'blog_sidebar_widget', 44 'name' => __( 'Blog sidebar widget', 'rosetta' ), 45 'description' => __( 'Add widgets here to appear in blog sidebar.', 'rosetta' ), 46 'before_widget' => '<div id="%1$s" class="widget %2$s">', 47 'after_widget' => '</div>', 48 'before_title' => '<h4 class="widget-title">', 49 'after_title' => '</h4>' 50 ); 51 register_sidebar( $args ); 52 53 // Pages 54 $args = array( 55 'id' => 'pages_sidebar_widget', 56 'name' => __( 'Pages sidebar widget', 'rosetta' ), 57 'description' => __( 'Add widgets here to appear in pages sidebar.', 'rosetta' ), 58 'before_widget' => '<div id="%1$s" class="widget %2$s">', 59 'after_widget' => '</div>', 60 'before_title' => '<h3 class="widget-title">', 61 'after_title' => '</h3>' 62 ); 63 register_sidebar( $args ); 64 65 } 66 add_action( 'widgets_init', 'rosetta_sidebars' ); 67 68 /** 36 69 * Prints a hint, which explains that that support questions belong 37 70 * to the forums, on top of the comment form. 38 71 */ -
sidebar-blog.php
7 7 <ul> 8 8 <?php wp_get_archives( 'type=monthly&limit=12' ); ?> 9 9 </ul> 10 11 <?php 12 if ( is_active_sidebar( 'blog_sidebar_widget' ) ) { 13 dynamic_sidebar( 'blog_sidebar_widget' ); 14 } 15 ?> -
sidebar-page.php
34 34 endif; 35 35 ?> 36 36 37 <?php 38 if ( is_active_sidebar( 'pages_sidebar_widget' ) ) { 39 dynamic_sidebar( 'pages_sidebar_widget' ); 40 } else { 41 ?> 37 42 <h3><?php _e( 'Resources', 'rosetta' ); ?></h3> 38 39 43 <p><?php _e( 'For help with installing or using WordPress, consult our documentation in your language.', 'rosetta' ); ?></p> 40 41 44 <ul> 42 45 <?php wp_list_bookmarks( 'categorize=0&category_before=&category_after=&title_li=&' ); ?> 43 46 </ul> 47 <?php 48 } 49 ?>