D
D
Denis2020-08-04 09:43:57
WordPress
Denis, 2020-08-04 09:43:57

Why doesn't Woocommerce see the ACF code?

Childish question: Why Woocommerce doesn't see ACF plugin code (custom fields)?
The code is in the footer. On the main page - it is displayed, on the Maganin page - no. Can you shed some light on this point? And how can it be solved (preferably taking into account ACF)?
For example, I took the code of a regular link

<a href="mailto:<?php the_field('email') ?>" class="mail">
  <span><?php the_field('email') ?></span>
</a>

In the browser (Shop page) shows the following code:
<a href="mailto" class="mail">
  <span></span>
</a>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Sobolev, 2020-08-04
@san_jorich

See cycle. I suspect that it the_field($field_name, $post_id);does not receive id

D
Denis, 2020-08-04
@Cobra8106

Ivan, alas, your option does not work, the result is the same

A
Anton Plawkevich, 2020-08-04
@antowa_plawkevich

Most likely, wp_query was called before your ACF and you did not reset it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question