Skip to content
Advertisement

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 fine! The problem is that Im trying to display ADs after every X post. But

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 based on

Add custom “Add to cart” button based on ACF field to WooCommerce single product page

I want to add an additionall custom “Add to cart button” on the single product page conditionally using this code: This variable is field from ACF $mamut = get_field(‘mamut’); However when I put this code into my functions.php file, the single product page crash I am using theme Twenty nineteen and Elementor Pro. I’ve tried to remove actions and then

Advertisement