admin管理员组

文章数量:1122846

So i migrated from localhost to my server, everything is working but my plugin cannot get the custom fields data anymore.

I get my custom fields this way:

$customs = get_post_custom($nodeid);
$customs['concertname'][0];

Then i tried get post meta and this also returns an empty string... The plugin i use is advanced custom fields, i use my own plugin to get the custom post data and put it in an xml. Local, everything is working like a charm. Plz help, this is for my finals :)

So i migrated from localhost to my server, everything is working but my plugin cannot get the custom fields data anymore.

I get my custom fields this way:

$customs = get_post_custom($nodeid);
$customs['concertname'][0];

Then i tried get post meta and this also returns an empty string... The plugin i use is advanced custom fields, i use my own plugin to get the custom post data and put it in an xml. Local, everything is working like a charm. Plz help, this is for my finals :)

Share Improve this question asked Jun 16, 2012 at 13:54 Toon Van DoorenToon Van Dooren 1012 bronze badges 1
  • what is get_post_custom? That's not a WordPress function – Tom J Nowell Commented Dec 2, 2022 at 13:27
Add a comment  | 

1 Answer 1

Reset to default 0

When you moved the site, did you export and then re-import the content? I'm wondering if maybe the custom data just didn't make it into the live server's database.

The first place to look for whether that's the case would be either on the post's edit screen or within the database itself with PHPMyAdmin or something similar.

Also, I tend to use get_post_meta() and send the key along as an argument instead of getting all of the values and using the key to pull it from the array like get_post_custom() requires, you might try that and see if that helps.

本文标签: migrationMigrated from localhost to server and cannot get customfields content anymore