Make WordPress Core


Ignore:
Timestamp:
05/25/2011 03:19:33 PM (13 years ago)
Author:
iandstewart
Message:

Twenty Eleven: make categories and tags i18n friendly; Props dimadin; Fixes #17531

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/content.php

    r17959 r18029  
    5555        <footer class="entry-meta">
    5656            <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
    57             <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in', 'twentyeleven' ); ?></span> <?php the_category( ', ' ); ?></span>
    58             <?php the_tags( '<span class="sep"> | </span> <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __( 'Tagged', 'twentyeleven' ) . '</span> ', ', ', '</span>' ); ?>
    59             <?php endif; ?>
     57            <?php
     58                /* translators: used between list items, there is a space after the comma */
     59                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     60                if ( $categories_list ):
     61            ?>
     62            <span class="cat-links">
     63                <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
     64                $show_sep = true; ?>
     65            </span>
     66            <?php endif; // End if categories ?>
     67            <?php
     68                /* translators: used between list items, there is a space after the comma */
     69                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     70                if ( $tags_list ):
     71                if ( $show_sep ) : ?>
     72            <span class="sep"> | </span>
     73                <?php endif; // End if $show_sep ?>
     74            <span class="tag-links">
     75                <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
     76                $show_sep = true; ?>
     77            </span>
     78            <?php endif; // End if $tags_list ?>
     79            <?php endif; // End if 'post' == $post->post_type ?>
    6080
    6181            <?php if ( comments_open() ) : ?>
     82            <?php if ( $show_sep ) : ?>
    6283            <span class="sep"> | </span>
     84            <?php endif; // End if $show_sep ?>
    6385            <span class="comments-link"><?php comments_popup_link( __( '<span class="leave-reply">Leave a reply</span>', 'twentyeleven' ), __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
    64             <?php endif; ?>
     86            <?php endif; // End if comments_open() ?>
    6587
    6688            <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
Note: See TracChangeset for help on using the changeset viewer.