Skip to content

Tag: advanced-custom-fields

ACF wordpress Modulo variable

I have some code. Trying to add ACF filed(number) instead static number So when I save this I have error like Fatal error: Uncaught DivisionByZeroError: Modulo by zero When I change <?php $fff = the_field(‘show_ad_every_x_posts’, ‘option’); ?> to <?php $fff = 7; ?> It works…

Editing this Snippet to Run One Time Only

We have thousands of custom posts where we need to update the_excerpt using this PHP snippet (which works great when a single post is saved). Is there a way to tweak this code so that we can run it one time (like when we load a page) and then delete it? We’re trying to update each post’s excerpt b…