Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="whitepaper" class="home_whitepaper_bg w-clearfix">
- <?php $lpcnt=0; if(have_rows('whitepaper_list')): ?>
- <?php while(have_rows('whitepaper_list')): the_row(); $lpcnt++; ?>
- <!-- Making rows for content, looping through and counting loops = lpcnt -->
- <!--
- ... Other content ...
- -->
- <?php
- the_sub_field('whitepaper_download_form');
- ?>
- <?php
- $pdf=get_permalink().'?download='.get_sub_field('whitepaper_pdf');
- ?>
- <a data-fancybox data-src="#whitepaper_popup_<?php echo $lpcnt; ?>" data-redirect="<?php echo $pdf; ?>" href="javascript:;" class="whitepaper_download_link w-inline-block w-clearfix">
- <!-- Here's the buttons for fancybox popups. They use the loop count to build a specific url - this is info I want later! -->
- <div id="whitepaper_popup_<?php echo $lpcnt; ?>" class="whitepaper_popup">
- <!-- using that loop count to get a specific div id! -->
- <div class="popup_whitepaper">
- <div class="whitepaper_form">
- <!--
- I could put a <?php echo do_shortcode...> here, no?
- Their current solution is to grab a javascript code from an ACF field.
- I have had a lot of trouble figuring out how to put the CF7 form in that field.
- -->
- <?php the_sub_field('download_form'); ?>
- <div class="w-clearfix"></div>
- </div>
- <button data-fancybox-close="" class="fancybox-close-small"></button>
- <div class="w-clearfix"></div>
- </div>
- </div>
- add_action( 'wp_footer', 'mycustom_wp_footer' );
- function mycustom_wp_footer() {
- ?>
- <script type="text/javascript">
- document.addEventListener( 'wpcf7mailsent', function( event ) {
- if ( 'FORM ID' == event.detail.contactFormId ) {
- location = <!-- specific url derived from $lpcnt? -->;
- }
- }, false );
- </script>
- <?php
- }
Add Comment
Please, Sign In to add comment