Get Custom Field Value
-
Hi, is it possible to get the custom field value by only JavaScript because I don’t know PHP.
Let’s say I got a post type ‘test’ and there is one custom field attached to it ‘name’.
If there is a button with the class name
btn
on the frontend, how do I get the value of ‘name’ by clicking the button? Something like this:const btn = document.querySelector('.btn'); btn.addEventListener('click', function() { let fieldValue; console.log(fieldValue); })
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Get Custom Field Value’ is closed to new replies.