Tag Info

New answers tagged

0

Alright. I figured out what I was wrong here. Because I wanted a Custom Post Type - then what I enter becomes part of that post. There's no other way around it. I could have done what I wanted to achieve by creating an Advanced Custom Field repeater and tying it to a page instead of tying it to a custom post type, but I'm not sure that would make life any ...


2

Your custom loop $catquery will override the "current" post, and so the_field will operate on the last post of that loop. Call wp_reset_postdata() right after your loop is finished (after endwhile;). This will restore the post global to the true "current" post.


0

I've found that the update_field() function actually does the job for me, I don't know if it's been updated since to make that happen. All you have to watch out for is if you have a single choice (select) field or one that allows multiple selections - you need to pass through an array of taxonomy ID's if it's multiples, basically. In example: $field_key = ...


1

I know this is an old ticket, but data importing is an ongoing challenge for users, I am sure! I've recently started using WP All Import, and I came across the same problem with ACF fields. Luckily, they came out with an extension for the plugin for exactly this problem: http://www.wpallimport.com/add-ons/ WP All Import ACF Add-On should handle this ...


0

You have two options. Either use get_field or the_field. get_field just reads out the field from the db without and screenoutput. like you did in your first line: $fields = get_field('testimonial'); the_field instead is get_field with an implied echo. <?php the_field('testimonial'); ?> so basically the_field would be enough. Aside you have to ...



Top 50 recent answers are included