Using ACF fields in Popups
-
Hello Daniel,
I am trying to add custom fields to the inside of a popup (the fields come from ACF on the post page for the Popup)add_action( 'popmake_popup_before_inner', 'kc_add_fields_to_popup' ); function kc_add_fields_to_popup(){ $queried_object = get_queried_object(); echo '<div class="one-half last">'; the_field('image_title', $queried_object); if( get_field('image_icon', $queried_object) ): ?> <img src="<?php the_field('image_icon', $queried_object); ?>" /> <?php endif; echo '<div class="one-half first">'; } add_action( 'popmake_popup_after_inner', 'kc_close_popup' ); function kc_close_popup(){ echo '</div>'; }
when I
var dump($queried_object)
I get the page on which I have the popup.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Using ACF fields in Popups’ is closed to new replies.