L
L
Lyubov Ivanova2018-03-26 12:41:16
WordPress
Lyubov Ivanova, 2018-03-26 12:41:16

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>

And the code for displaying additional fields Thank you very much in advance for your help
<?php 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 question

Ask a Question

731 491 924 answers to any question