时间:2021-07-01 10:21:17 帮助过:28人阅读
//show contribute meta data function contribute_metadata( $content ){ if( is_single() ){ $DXC_options = get_option( 'DX-Contribute-options' ); $pid = get_the_ID(); $metas = get_post_meta( $pid, '_DX_Contribute', true ); if( $DXC_options['meta-on'] = 'on' && $metas ){ $avatar = get_avatar( $metas['email'], 25 ); $url = ($metas['site'] == 'true') ? '' : $metas['site']; $user = $metas['user']; $site = ( $url ) ? ''.$user.'' : ''.$user.''; $style = ''; $meta_code = ''.$avatar.''.$site.' 提交于'.get_the_time( 'Y-m-d H:i:s' ).''; if( $DXC_options[ 'metapo' ]=='head' ){ $content = $style.$meta_code.$content; } else $content .= $style.$meta_code; } } return $content; }
这一段是插件内的内容,他将自动在文章页面内重输出文章内容
但是我想在首页指定地方输出$user的内容怎么做到呢