Advanced Custom Forms PHP formatting for do_shortcode

Even though you are echoing the shortcode, I think you still need to echo the ACF field inside the string of the do_shortcode function. Change your ACF field return function for the_field() : <?php echo do_shortcode(“[tnc-pdf-viewer-iframe file=”.the_field(‘document_link’).” width=”900px” height=”700px” download=”false” print=”false” fullscreen=”true” share=”true” zoom=”true” open=”true” pagenav=”true” logo=”true” find=”true” current_view=”true” rotate=”true” handtool=”true” doc_prop=”true” toggle_menu=”true” toggle_left=”true” scroll=”true” … Read more

Using id to show item

If the GPX file is attached to the current page you can find it with get_attached_media(), e.g. $gpx_files = get_attached_media( ‘application/gpx+xml’ ); if ( count( $gpx_files ) >= 1 ) { echo do_shortcode (‘[sgpx gpx=”‘ . wp_get_attachment_url( $gpx_files[0]->ID ) . ‘”]’); } else { echo ‘<p class=”warning”>No GPX file attached!</p>’; }

Download Featured Image Link in Post Shortcode

You can use add_shortcode function to register a custom shortcode for your site. For example like this, // add to (child) theme’s functions.php function my_download_featured_image_link( $atts, $content=”” ) { // shortcode should return its output return sprintf( ‘<a class=”download_image” href=”https://wordpress.stackexchange.com/questions/356495/%s”>%s</a>’, // html output of the shortcode esc_url( get_the_post_thumbnail_url(null, ‘full’) ), // defaults to current global … Read more

alternate left – right content inside the loop

You should be able to get the current index in loop from the global $wp_query object. With the help of modulo you can then set an alternating css class for a post. global $wp_query; while ( have_posts() ) { the_post(); $alignment = ( ($wp_query->current_post + 1) % 2 === 0 ) ? ‘even align-right’: ‘odd … Read more