最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - 500 Error, Get custom field and returning it

programmeradmin4浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论