Skip to content
Advertisement

Tag: advanced-custom-fields

PHP 7.4.21 Strange Behaviour inside WordPress

I’m puzzled by the behaviour of PHP 7.4.21. Inside a Wordpress page I have this piece of code: the function the_field() is a function of ACF (Advanced Custom Fields) plugin and returns a string with the content the user has set inside the custom field. The strange behviour I’m referring to is that inside the ifs all the blocks of

the_field – ACF not working in ‘while’ loop

Main string of code (that doesn’t work): <span class=”price-in-kune”><?php the_field(‘tariff_price_kn’) ?> kn</span> The ways i tried to solve this problem: put insted of the_field(‘tariff_price_kn’) – echo(‘hi’) – the code worked add $post_id -> the_field(‘tariff_price_kn’, $post_id) $currencyKune = get_field(‘tariff_price_kn’); And then echo $currencyKune P.S 3) i don’t know exactly where should i put $currencyKune = get_field(‘tariff_price_kn’), so i put it before

Get parameter of shortcode in Insert PHP Code Snippet plugin using ACF repeater

Everybody hello! I’m sorry for asking such kind easy question, I’m pretty new at this. I have problem with transfering parameter value and echoing it to itself. PHP code snippet on page: [xyz-ips snippet=”Generating-content” paramSet=”1″] Inside ‘generating content’: Right now I need to change condition if($sub_value == 1) to if($sub_value == “PARAMETER VALUE”) Please help, guys! Answer Thank you guys

ACF & WordPress Media Library

I’ve got an ACF ‘options page’ with a placeholder image within, to fall back to if a client removes the image from the post/page by mistake. And I’m using the following code to handle this situation happening. This works fine once pages or posts are saved. However The issue I have is if the page/post has been previously saved with

How to display ACF field after the product name on the cart and order reviews in WooCommerce?

I have Advanced Custom Fields setup for post type on WooCommerce Products. So each product has 1 unique custom field. I’m trying to display the custom field after the product name on the cart and the checkout page and order table information. However, running into problems as my code doesn’t display any output. Any advice on how to achieve this

Advertisement