如果用户meta是空白回音的东西?

I'm trying to add a custom profile avatar to Wordpress. I have the field added to the profile and it saves everything fine, but I'm trying to make a conditional that if the user does not upload a custom file, it defaults to the gravatar.

I have this so far:

<?php if(get_the_author_meta('da_avatar') != ''): ?>
    <p>Exists!</p>
 <?php else: ?>
    <p>Does not exist!</p>
<?php endif; ?>

da_avatar is the ID of the custom field within the profile. This function always yields "DOES NOT EXIST" even if the field is not blank.

Any idea on why it is not working and how I can make it so that if the custom avatar field is empty, it will display "does not exist" and if it is not empty, have it display "Exists!"

I'm guessing it's because of where you're running this code. Try adding the User ID as the second parameter. I've also updated your code slightly to make it easier to use 'da_avatar' once you've performed the check.

My suggestion would be to do the following:

<?php if ( $da_avatar = get_the_author_meta( 'da_avatar', $user_id ) ) : ?>
    <p>Exists!</p>
<?php else : ?>
    <p>Does not exist!</p>
<?php endif; ?>

Make sure you replace $user_id with a valid user ID. If that works let me know where you're running this code and I'll talk you through setting it up properly.