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>'
  • You're missing a semicolon: instagram</a>'. – Jacob Peattie Jul 28 '19 at 4:16

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.org/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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.