I’ve a problem.
I’ve created a website (using Jupiter Theme) and the articles are been migrated by other database.
In many articles there are attachments or postObject sub_fields (created by Repeater add-on).
Those subfields are already filled by the migrate of the database, so when I’ve viewed an article (back-end side) the attachments or postObject are setted.
When I viewed the article (front-end side) the attachment or postObject can’t view.
But if I go back in back-end side of the article and I upload a attachment file or add a postObject, In font-end side of article I see the custom field uploaded.
I’ve many categories and for each of they I’ve different ‘custom fields’ and ‘sub fields’.
That’s the code that I’ve used:
for custom field text :
<?php if( get_field(‘evento_primopiano’) ): ?>
Primo piano: <?php the_field(‘evento_primopiano’); ?>
<?php endif; ?>
For attachment in repeater sub field:
// check if the repeater field has rows of data
if( have_rows(‘evento_allegati’) ):
// loop through the rows of data
while ( have_rows(‘evento_allegati’) ) : the_row();
// display a sub field value
?>Allegati: “target=’_blank’ “><?php echo get_sub_field(‘evento_allegato_titolo’); ?>
// no rows found
And for postObject in repeater sub fields:
$attivita_eventi = get_field(‘evento_rassegnestampa’);
if ($attivita_eventi): ?>
$p = get_sub_field(‘evento_rassegnastampa’);
Rassega stampa correlata : “><?php echo $p->post_title; ?>
<?php endwhile; ?>
<?php endif; ?>
Thank you so much for your support.
Hi! thank you for answer.
I’m using ACF 4.4.5 and the add-on Repeater CF 1.1.1 version.
I have a old site structured by many fields with text, dates or relation post.
Now I’ve migrated this informations in custom field.
The text fields are viewed but the attachment and the postObkect no.
Thank you so much
The reason that some fields are not showing up on the new site is most likely because the field keys for those fields are different on the new site but the key stored in the database is still the key from the old site. When this happens ACF does not know what to do with the data in those fields.
The simplest but probably the most time consuming way to fix this would be to open and save every page on your site. This would cause ACF to save the correct field key.
You could attempt to export the ACF posts using the standard WP export and import them to your new site, but if you’ve changed the groups then you’ll have a problem with any new data that you’ve entered.
You can go into MySQL and to a search & replace to replace all the new field key values with the old field key values in the postmeta table.
Make sure you back up your database if you try either of the last 2.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.