Making WordPress.org

Changeset 6044


Ignore:
Timestamp:
10/18/2017 10:19:27 PM (7 years ago)
Author:
ocean90
Message:

Rosetta Theme: Use a navigation menu for resources.

Use wp_list_bookmarks() only as a fallback.

Fixes #3179.

Location:
sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta
Files:
2 edited

Legend:

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

    r1641 r6044  
    2727    ) );
    2828
    29     register_nav_menu( 'rosetta_main', __( 'Main Menu', 'rosetta' ) );
    30 
     29    register_nav_menus( [
     30        'rosetta_main'      => __( 'Main Menu', 'rosetta' ),
     31        'rosetta_resources' => __( 'Resources', 'rosetta' ),
     32    ] );
    3133    remove_action( 'wp_head', 'locale_stylesheet' );
    3234}
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/sidebar-page.php

    r2250 r6044  
    3232<p><?php _e( 'For help with installing or using WordPress, consult our documentation in your language.', 'rosetta' ); ?></p>
    3333
    34 <ul>
    35     <?php wp_list_bookmarks( 'categorize=0&category_before=&category_after=&title_li=&' ); ?>
    36 </ul>
     34<?php
     35if ( has_nav_menu( 'rosetta_resources' ) ) {
     36    wp_nav_menu( [
     37        'theme_location' => 'rosetta_resources',
     38        'container'      => false,
     39        'depth'          => 1,
     40        'fallback_cb'    => false,
     41    ] );
     42} else {
     43    ?>
     44    <ul>
     45        <?php wp_list_bookmarks( 'categorize=0&category_before=&category_after=&title_li=&' ); ?>
     46    </ul>
     47    <?php
     48}
Note: See TracChangeset for help on using the changeset viewer.