在下面的函数上,在echo \'</span>\';
, 我想添加一段代码:
<a href="<?php $key="link"; echo get_post_meta($post->ID, $key, true); ?>" target="_blank">Images Source</a>
但我不知道怎么做,有什么建议吗?
//echo \'<div class="pull-left">\';
echo in_array( \'date\',$meta_info ) ? sprintf( \'<span class="post-meta-info posted-on">\' . apply_filters(\'yt_icon_date_time\', \'<i class="fa fa-clock-o"></i>\') . \' %1$s</span>\',
$time_string
) : \'\';
if( in_array( \'comments\',$meta_info ) ){
echo \'<span class="post-meta-info with-cmt">\' . apply_filters(\'yt_icon_comment\', \'<i class="fa fa-comments"></i>\') . \' \';
comments_popup_link( __( \'0 Comments\', \'theme\' ), __( \'1 Comment\', \'theme\' ), __( \'% Comments\', \'theme\' ));
echo \'</span>\';
}
//echo \'</div>\';
SO网友:Chinmoy Kumar Paul
if( in_array( \'comments\',$meta_info ) ){
$key="link";
echo \'<span class="post-meta-info with-cmt">\' . apply_filters(\'yt_icon_comment\', \'<i class="fa fa-comments"></i>\') . \' \';
comments_popup_link( __( \'0 Comments\', \'theme\' ), __( \'1 Comment\', \'theme\' ), __( \'% Comments\', \'theme\' ));
echo \'</span>\';
echo \' <a href="\'. get_post_meta($post->ID, $key, true) .\'" target="_blank">Images Source</a>\' . "\\n";
}
请尝试此代码一次。我用您提供的内容修改了代码。