//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 ) ? '<a href="'.$url.'" rel="external nofollow" target="_blank">'.$user.'</a>' : '<a rel="nofollow" style="color: #EF4372;">'.$user.'</a>';
$style = '<style type="text/css">#contribute-metadata{line-height:25px;margin:10px 0;} #contribute-metadata img{display:block;float:left;margin-right:5px;}</style>';
$meta_code = '<div id="contribute-metadata">'.$avatar.'<div id="contribute-site">'.$site.' 提交于'.get_the_time( 'Y-m-d H:i:s' ).'</div></div><div style="clear:both;"></div>';
if( $DXC_options[ 'metapo' ]=='head' ){
$content = $style.$meta_code.$content;
}
else $content .= $style.$meta_code;
}
}
return $content;
}
这一段是插件内的内容,他将自动在文章页面内重输出文章内容
但是我想在首页指定地方输出$user的内容怎么做到呢
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 ) ? '<a href="'.$url.'" rel="external nofollow" target="_blank">'.$user.'</a>' : '<a rel="nofollow" style="color: #EF4372;">'.$user.'</a>';
$style = '<style type="text/css">#contribute-metadata{line-height:25px;margin:10px 0;} #contribute-metadata img{display:block;float:left;margin-right:5px;}</style>';
$meta_code = '<div id="contribute-metadata">'.$avatar.'<div id="contribute-site">'.$site.' 提交于'.get_the_time( 'Y-m-d H:i:s' ).'</div></div><div style="clear:both;"></div>';
if( $DXC_options[ 'metapo' ]=='head' ){
$content = $style.$meta_code.$content;
}
else $content .= $style.$meta_code;
}
}
return $content;
}
这一段是插件内的内容,他将自动在文章页面内重输出文章内容
但是我想在首页指定地方输出$user的内容怎么做到呢