Answer the question
In order to leave comments, you need to log in
How to pass data-id value to $post_id get_field?
Good afternoon.
There is a post announcement page. Each announcement has a link leading to one popup that displays the value of an additional field of a particular post. In this link, I display the value of the post id in the data-id parameter. The question is how to pass the data-id value to $post_id get_field?
Link Example
<a class="popup-3" href="" data-id="<?= get_the_ID();?>"><p>посмотреть </p></a>
echo get_field("значение", $post_id);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question