简体   繁体   中英

WordPress AuthorBox customization not working. What am I doing wrong?

I have an interesting setup with my author box code and I can't figure out why the short code isn't displaying. This is displaying on a custom post type, not a normal post (not sure if that makes a difference). The shortcode is the only part of the code not working. Everything else is just fine.

    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;
}

Ugh. Figured it out. Just had to use \\"$author_id\\" instead. Sorry

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM