如果未找到字段,我试图显示类似“抱歉,此处无信息”的消息,如果找到字段,则不应显示任何消息。我正在使用ACF插件在用户配置文件的前端显示字段。
这是我的代码:
<?php $user_ID = get_current_user_id();
$label = \'user_\' . $user_ID;
the_field(\'Information\', $label); ?>
如果有人有想法的话,我已经尝试了很多东西,但没有任何帮助。提前谢谢。尼科
*Update: In fact, with ACF plugin for wordpress, I have created a field to display in user account in the backend of wordpress. So now I want to display this field (information) in the frontend account of the user.
If I need to put a message for my client, I put this message in the wordpress backend user account.
So in the frontend account, if I don\'t have put any message in this field (information), I want to display an automatic message like: "You don\'t have information yet"
If I put a message in the field (information) in the wordpress backend user account, I want the automatic message disappear and my message is displayed.
for now the message I put in field (information) in the backend account user is displayed correctly in the frontend user account *