Use Popup ID for custom fields, not page ID
-
Hi! I have the following setup:
– A page with a clickable element, which triggers a pop-up.
– A pop-up that contains Advanced Custom Fields shortcodes for custom fields.
– Custom fields assigned to the “pop-up” post type, filled out on the pop-up edit page (along with the click trigger and other settings).When I visit the page and click on the element, the pop-up pops up as expected. However, instead of displaying the data from the pop-up’s custom fields, it attempts to display (nonexistent) data from the page itself. (For example, if one field was “title”, the pop-up’s title was “Indiana”, and the page’s title was “United States”, the pop-up would show “United States” rather than “Indiana”.)
If I adjust the ACF shortcode to explicitly call out the pop-up’s post ID, it’s able to pull the correct data (so for the previous example, pull the title “Indiana”).
So it seems like the issue is that the custom fields are not receiving the popup’s post ID when the popup is triggered. Ideally, I don’t want to have to explicitly call out the ID for each popup, since I want the popups to be easily recreatable in the future. Is there a way to tell the popup that, when it’s triggered, it needs to send its post ID to the ACF fields so they don’t use the page’s ID?
- The topic ‘Use Popup ID for custom fields, not page ID’ is closed to new replies.