site-求教php问题,如何在wordpress主题里输出插件的内容
程序员文章站
2022-05-08 16:37:07
...
site插件phpwordpress插件wordpress
//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的内容怎么做到呢