[英]WordPress AuthorBox customization not working. What am I doing wrong?
我的作者框代碼有一個有趣的設置,但我不知道為什么短代碼沒有顯示。 這是在自定義帖子類型上顯示的,而不是在普通帖子上顯示(不確定是否有所不同)。 短代碼是代碼中唯一不起作用的部分。 其他一切都很好。
function my_genesis_author_box( $output, $context, $pattern, $gravatar, $title, $description ) {
$twitter = get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) );
$author_id=get_the_author_meta('ID');
$description = '<br/><a href="' . $twitter . '">More Mixes</a><br/>' . do_shortcode( '[mycred_my_rank user_id=$author_id]' );
$output = sprintf( $pattern, $gravatar, $title, $description );
return $output;
}
啊。 弄清楚了。 只需使用\\“ $ author_id \\”代替。 抱歉
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.