php - 500 Error, Get custom field and returning it

I am using this code but getting a 500 error on the IF part. Not sure why this happens. $instac = get_the_author_meta( &

I am using this code but getting a 500 error on the IF part. Not sure why this happens.

$instac = get_the_author_meta( 'au-instagram', $current_author->ID );
if (!empty($instac)) {
    return '<a href="' . $instac . '" class="kalim">instagram</a>'
} 

I am using this code but getting a 500 error on the IF part. Not sure why this happens.

$instac = get_the_author_meta( 'au-instagram', $current_author->ID );
if (!empty($instac)) {
    return '<a href="' . $instac . '" class="kalim">instagram</a>'
} 
Share Improve this question edited Jul 27, 2019 at 20:21 nmr 4,5672 gold badges17 silver badges25 bronze badges asked Jul 27, 2019 at 20:13 JoaMikaJoaMika 6986 gold badges27 silver badges58 bronze badges 1
  • You're missing a semicolon: instagram</a>'. – Jacob Peattie Commented Jul 28, 2019 at 4:16
Add a comment  | 

1 Answer 1

Reset to default 0

500 error or internal server error is probably caused by a PHP error. By enabling WordPress debug, you’ll easily find where the problem is. You can follow the instructions here https://wordpress/support/article/debugging-in-wordpress/#wp_debug_log

From your code, it’s easy, you’re missing a semi-column before the closing curly bracket.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745288920a4620736.html

相关推荐

  • php - 500 Error, Get custom field and returning it

    I am using this code but getting a 500 error on the IF part. Not sure why this happens. $instac = get_the_author_meta( &

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信