In my case I wanted the form repeated for each organization (ultimately would appear in a pop-up) with the respective organization’s email populating a hidden “Send To” field.
<?php if( have_rows(‘add_contact’) ): ?>
<?php endwhile; ?>
<?php endif; ?>
I think I am getting closer. The code below is returning the file paths but not creating the zip. Should I be using get_attached_file here?
<?php $files_to_zip = array(); // create array
$blogusers = get_users();
$zip = new ZipArchive;
$zip->open('file.zip', ZipArchive::CREATE);
foreach ( $blogusers as $user ) {
$zip->addFile(the_field('upload_vcard', 'user_'. $user->ID )); }
print_r($files_to_zip);// debug - return file names OK
$zip->close();
?>
It is helpful to know to run the user query first, but my main question is how to take the file field value and create a zip from that. I understand if this is outside of the scope of support here, but if you do know of any helpful links for the create zip side of the question I would greatly appreciate it!
Sorry for the repeat question. I was having trouble finding the right words to get the results I was looking for when searching this topic. Thank you!
I really appreciate your efforts to look into this further! I think it comes down to a conflict between the theme and the WP Download Manager. ACF continues to be a terrific plugin, I use it on all my sites.
Here’s the plugin website: http://www.wpdownloadmanager.com/ I have WP Download Manager PRO version. And here is the forum: http://www.wpdownloadmanager.com/support/forum/download-manager-pro/
Thanks again!
That would be awesome! The plugin is WP Download Manager and it seems to be an issue with the main query. If I use wp_query the ACF fields will return a value. Unfortunately I can’t use wp_query on an archive and have functioning pagination.
I posted to the WP Download Manager forum as well. Thank you for all your help. Should I mark as resolved since the issue isn’t technically with ACF?
It looks to be a plugin conflict with tags and categories, you are correct that date, author, etc. archives are functioning properly. If I figure out a fix I will post here. Thanks!
Thank you for the quick response. The option values appear on the footer of every page/post EXCEPT the archive.php template, which leads me to believe the problem is similar to this FAQ. I cannot figure out how to get this solution to work because I am dealing with option page fields + sub fields.
I think the code is fine, please see below.
<div class="section group">
<?php if( have_rows('footer_widgets', 'option') ): ?>
<?php while( have_rows('footer_widgets', 'option') ): the_row(); ?>
<div class="col span_1_of_2">
<h2><?php the_sub_field('heading'); ?></h2>
<?php the_sub_field('description'); ?>
<a href="<?php the_sub_field('button_link'); ?>" class="footer-cta-btn"><?php the_sub_field('button_name'); ?></a>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
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 use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.