Fixed it!
This is the resulting code:
<?php
$images = get_field('extra_photos');
if( $images ): ?>
<div class="row2">
<?php foreach( $images as $image ): ?>
<div class="column2" >
<img src="https://wordpress.stackexchange.com/questions/337143/<?php echo $image["url']; ?>" alt="https://wordpress.stackexchange.com/questions/337143/<?php echo $image["alt']; ?> " onclick="myFunction(this);"/>
</div>
<?php endforeach; ?>
</div>
<!-- The expanding image container -->
<div class="container2">
<!-- Close the image -->
<span onclick="this.parentElement.style.display='none'" class="closebtn">×</span>
<!-- Expanded image -->
<img id="expandedImg" style="width:100%">
<!-- Image text -->
<div id="imgtext"></div>
</div>
<?php endif; ?>
Related Posts:
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- Using an Image Slider twice on the same page
- Delete images from media library when user deletes an image from ACF Gallery
- How to store checkbox data for individual users?
- ACF values to Script with auto refresh
- ACF Gallery field images donwload
- How to output values from a loop into a javascript array
- Pulling Products from an API
- Generate a radius search of custom post type locations
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- Dynamic Gallery
- Display message once per session to users with a specific role
- How to use the php if statement [closed]
- lazy load comments wordpress on click
- Unique key for each row in a repeater field
- Using a javascript file to access a get posts array
- Minify HTML, CSS, JS with PHPWee?
- Run a Parallel PHP Application with WordPress
- Uncaught TypeError: Cannot read property ‘firstChild’ of null after upgrading to WordPress 5.5
- Access/update database with jQuery
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- admin-ajax.php responding with 0
- How can the plugin directory path be returned into ?
- Customizer Show/Hide
- Page Reloads Before AJAX Request Finishes
- Looking for most performant way to execute several similar WP queries within shortcodes
- How do I fetch all comments per post via WP REST API?
- Ajax return code 400
- Pass PHP variable to JavaScript without inline JS
- Show post in slider
- Trouble With Conditional Logic in PHP
- How do I display a user’s previous orders as a select box option on a product?
- How to pass aa JS variable to PHP?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- Menu jumping when calling it via PHP
- Setting value of session with Ajax not working
- Accessing WPDB Multidimensional JSON Array w/ Javascript
- How to optimize the IF condition with many conditions and same output [closed]
- Advanced Custom Fields – display label and value only if value entered
- admin-ajax Firing Error 400 When Logged In
- Jquery window.send_to_editor function
- WordPress gallery shortag
- How to add drag and drop functionalities to a div inside option panel
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- ACF Repeater Pagination stopped working since upgrade to php7.2
- How to change logo by category
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Refactoring long if/else php chains
- Incrementing PHP variable onclick to display posts by month
- Show get_sub_field value if it exists [closed]
- Update post meta – Custom field does not match meta-key
- Run JS Code on userlog out
- Covert WordPress Blogname into JQuery
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- PHP variables in a post?
- How to sort posts by active category in WordPress?
- Hot to check if new posts have been published since page load and notify online users?
- Time Delay a URL Redirect for Specific Page
- Cascading dropdown select search based on Parent Page & Child Page
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Display acf taxonomy attachment
- Nested Queries of decreasing specificity
- Variation prices breakdown only for single product page
- Unable to display multiple parameters from url by javascript through shortcodes
- Settings API form – submit with AJAX
- Adding HTML Code to Replace Text in PHP
- ACF: Display Google Map in frontend issues
- How to use wp_ajax_set_post_thumbnail?
- Passing a value from an input field to a php function in WordPress?
- Ajax search box displays nothing if taxonomy doesn’t exist
- Google CSE Malfunctions via Chrome/Safari on Mobile When Clicking on Either Search Icon/Menu Icon. How to Make Google CSE Default Theme Search
- I have a lot of JavaScript erorrs after SSL someone can help me?
- Store data from JavaScript object to custom table in user account
- register dependency css and js inside a plugin class
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Modifying child theme’s header
- Show the subcategory name based on current product
- Show subcategory name selected in specific category woocoommerce
- Move Jquery.js to Footer
- Bring Font Awesome icons inside menu A tags
- Automatically refresh page if widget is added to page?
- number of posts with “Load More”
- Complex PHP for json_encode > how to handle/output right?
- How can i iterate through this shortcode array?
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- Sort by multiple options in custom field
- add bootstrap modal after login in wordpress
- If or/and statement advanced custom fields [closed]
- Help with my first Metabox helper class
- Top menu disapears in Category Pages when filtering using ACF
- Add multiple JavaScript files to template header [duplicate]
- What’s the best way to format ACF number fields for display on the front end?
- Add specific phrase after every product title including the discounted price? [closed]
- link to page_for_posts
- Trouble figuring out how to get my button to submit comment
- Show button in header when product custom field is not empty