是否从主题中删除与作者、帖子和类别相关的文本?

时间:2011-01-03 作者:user2266

如何删除?

“作者档案:Merms”,在线http://shs.merms.info/author/Merms.使用二二十修改。不使用边栏小部件。

1 个回复
SO网友:Adam Thompson

在功能上。php查找:

 if ( ! function_exists( \'twentyten_posted_on\' ) ) :
/**
 * Prints HTML with meta information for the current post—date/time and author.
 *
 * @since Twenty Ten 1.0
 */
function twentyten_posted_on() {
    printf( __( \'<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s\', \'twentyten\' ),
        \'meta-prep meta-prep-author\',
        sprintf( \'<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>\',
            get_permalink(),
            esc_attr( get_the_time() ),
            get_the_date()
            ),
        sprintf( \'<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>\',
            get_author_posts_url( get_the_author_meta( \'ID\' ) ),
            sprintf( esc_attr__( \'View all posts by %s\', \'twentyten\' ), get_the_author() ),
            get_the_author()
        )
    );
}
endif;
更改为:

if ( ! function_exists( \'twentyten_posted_on\' ) ) :
/**
 * Prints HTML with meta information for the current post—date/time and author.
 *
 * @since Twenty Ten 1.0
 */
function twentyten_posted_on() {
    printf( __( \'<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s\', \'twentyten\' ),
        \'meta-prep meta-prep-author\',
        sprintf( \'<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>\',
            get_permalink(),
            esc_attr( get_the_time() ),
            get_the_date()
        ),

    );
}
endif;
换言之,您只是删除了以下代码位:

sprintf( \'<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>\',
                get_author_posts_url( get_the_author_meta( \'ID\' ) ),
                sprintf( esc_attr__( \'View all posts by %s\', \'twentyten\' ), get_the_author() ),
                get_the_author()
            )

结束

相关推荐