@hube2 Thanks for the answer! I was able to upload videos in the ACF Gallery without needing to set anything specific. The only difference is that while the native media library accepts my function for thumbnail generation (see screenshot 1), the ACF gallery won’t take the parameters as mentioned (see screenshot 2).
As said, nothing has been set from my end to allow to upload video in the gallery
Any idea why this could happen?
Thanks
Sorry, I perhaps didn’t explain my problem properly.
I want the content to be always shown, but remove the link if the link field is empty.
Hi,
Is it possible to display different outputs/formats for the date?
This snippet works great but I would like to show Year and Month separately.
Is it possible?
Thanks
Hello,
I’m having a repeater working as an events list.
I managed to sort them by date but, what I would like to achieve is that it only shows the year once if multiple events are happening in the same year.
Currently:
2020. Event 1
2020. Event 2
2020. Event 3
2019. Event 4
2018. Event 5
2017. Event 6
2017. Event 7
2016. Event 8
What I want:
2020. Event 1
Event 2
Event 3
2019. Event 4
2018. Event 5
2017. Event 6
Event 7
2016. Event 8
Is this possible?
I know that WordPress native date function shows it repeated years only once unless you echo them.
Here’s my code:
<?php
$repeater = get_field('press');
$order = array();
foreach ($repeater as $i => $row) {
$order[$i] = strtotime($row['date']);
}
array_multisort($order, SORT_DESC, $repeater);
if ($repeater): ?>
<ol style="list-style-type:none;">
<?php foreach ($repeater as $i => $row): ?>
<li>
<?php echo $row['date']; ?> <a href="<?php echo
$row['link']; ?>" target="_blank"><?php echo $row['article']; ?>
</a>
</li>
<?php endforeach; ?>
</ol>
<?php else:
echo '<p>No press yet!</p>';
endif; ?>
Thanks a lot! It worked
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.