Making WordPress.org

Changeset 1641


Ignore:
Timestamp:
05/30/2015 10:26:47 PM (9 years ago)
Author:
ocean90
Message:

Rosetta Theme: Enhancements

  • Move sidebar code to its own files.
  • Show blog section on front page only when show_on_front is posts.
  • Add some inline docs.

props ramiy.
fixes #1057, #1051.
see #1049.

Location:
sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta
Files:
1 added
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/front-page.php

    r1629 r1641  
    6262                </div>
    6363                <div class="col-3">
    64 <?php
    65     get_template_part( 'download-sidebar' );
    66 ?>
     64                    <?php get_sidebar( 'page' ); ?>
    6765                </div>
    6866            </div>
     
    125123    </div>
    126124<?php endwhile; ?>
     125<?php if ( 'posts' === get_option( 'show_on_front' ) ) : ?>
    127126        <div class="wrapper">
    128127            <div id="blog" class="section">
     
    143142
    144143                <div class="col-3">
    145                     <h5><?php _e( 'Blog Archives', 'rosetta' ); ?></h5>
    146                     <ul>
    147                         <?php wp_get_archives('type=monthly&limit=12'); ?>
    148                     </ul>
     144                    <?php get_sidebar( 'blog' ); ?>
    149145                </div>
    150146            </div>
    151147        </div>
     148<?php endif; ?>
    152149</div>
    153150<?php get_footer();
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/functions.php

    r1631 r1641  
    3333add_action( 'after_setup_theme', 'rosetta_after_setup_theme' );
    3434
     35/**
     36 * Prints a hint, which explains that that support questions belong
     37 * to the forums, on top of the comment form.
     38 */
    3539function rosetta_comment_form_support_hint() {
    3640    printf(
     
    4246add_action( 'comment_form_top', 'rosetta_comment_form_support_hint' );
    4347
     48/**
     49 * Show a home link for our wp_nav_menu() fallback, wp_page_menu().
     50 *
     51 * @param array $args An optional array of arguments.
     52 * @return array The filtered array of arguments.
     53 */
    4454function rosetta_wp_page_menu_args( $args ) {
    4555    $args['show_home'] = true;
     
    4858add_filter( 'wp_page_menu_args', 'rosetta_wp_page_menu_args' );
    4959
     60/**
     61 * The nav menu supports only top level menu items.
     62 */
    5063function rosetta_admin_footer_nav_menus() {
    5164    echo '<script> wpNavMenu.options.globalMaxDepth = 0; </script>';
     
    5366add_action( 'admin_footer-nav-menus.php', 'rosetta_admin_footer_nav_menus' );
    5467
     68/**
     69 * Extend the default WordPress body classes.
     70 *
     71 * @param array $classes A list of existing body class values.
     72 * @return array The filtered body class list.
     73 */
    5574function rosetta_body_class( $classes ) {
    5675    $classes[] = 'wporg-responsive';
     
    6079add_filter( 'body_class', 'rosetta_body_class' );
    6180
     81/**
     82 * Checks if locale provides a custom stylesheet.
     83 *
     84 * @return boolean True if file exists, false if not.
     85 */
    6286function is_locale_css() {
    6387    global $rosetta;
     
    6589}
    6690
     91/**
     92 * Returns URL to locale's custom stylesheet.
     93 *
     94 * @return string URL to custom stylesheet.
     95 */
    6796function get_locale_css_url() {
    6897    global $rosetta;
     
    7099}
    71100
    72 // Makes final space a non-breaking one, to prevent orphaned word.
     101/**
     102 * Makes final space a non-breaking one, to prevent orphaned word.
     103 *
     104 * @param string $string
     105 * @return string
     106 */
    73107function rosetta_orphan_control( $string ) {
    74108    return substr_replace( $string, '&nbsp;', strrpos( $string, ' ' ), 1 );
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/index.php

    r1624 r1641  
    3232        </div>
    3333        <div class="col-3">
    34             <div class="blog-categories">
    35                 <h4><?php _e( 'Categories', 'rosetta' ); ?></h4>
    36                 <ul>
    37                     <?php wp_list_categories( 'title_li=&show_count=1&orderby=count&order=DESC&number=10' ); ?>
    38                 </ul>
    39             </div>
     34            <?php get_sidebar( 'blog' ); ?>
    4035        </div>
    4136    </div>
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/page.php

    r1615 r1641  
    1515            </div>
    1616            <div class="col-3">
    17                 <?php get_template_part( 'download-sidebar' ); ?>
     17                <?php get_sidebar( 'page' ); ?>
    1818            </div>
    1919        </div>
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/single.php

    r1624 r1641  
    4141        </div>
    4242        <div class="col-3">
    43             <div class="blog-categories">
    44                 <h4><?php _e( 'Categories', 'rosetta' ); ?></h4>
    45                 <ul>
    46                     <?php wp_list_categories( 'title_li=&show_count=1&orderby=count&order=DESC&number=10' ); ?>
    47                 </ul>
    48             </div>
     43            <?php get_sidebar( 'blog' ); ?>
    4944        </div>
    5045    </div>
Note: See TracChangeset for help on using the changeset viewer.