This way of wokring with slides seems to be as popular as it is terrible… 🙂 I coded something very much like this recently.
Basic idea, adjust as needed:
$id = get_the_ID();
$slides = array();
$i = 1;
foreach( get_post_custom_keys( $id ) as $key )
if ( false !== strpos( $key, 'slide' ) )
$slides[$key] = get_post_meta( $id, $key, true);
while( isset( $slides["slide{$i}"] ) ) {
echo '<img src="' . wp_get_attachment_url( $slides["slide{$i}"] ). '" />';
$i++;
}
Related Posts:
- how to allow download after newsletter subscription?
- How to call WordPress PHP file using external js file
- jQuery function not working in WordPress but works in jsfiddle
- why does so many javascript libraries are loaded along with my website?
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- How to insert fancybox to multiple separate galleries in a post?
- wordpress ajax upload media not working
- Why does my media selection script write to ONLY the first input field?
- Creating Log-In Page for backend server
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- how to do display: block after user login
- $ not defined using jQuery in WordPress
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Multiple level category drop-down three levels is not working
- Dashboard controls have all stopped working
- Special Characters and Spaces are not transferred correctly via AJAX call.
- How to manipulate elements on the Insert Media Attachment settings popup
- How to pull data from a table using wpdb?
- Update a parent theme JQuery property in the child theme
- How to send json data to jquery
- Help with customising love it plugin (use within foreach)
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- Reload selected post in multiple post query with ajax
- Site images are fixed in front of my site content [closed]
- Jquery scroll animate offset asynchronous
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- I was wondering if it’s possible to implement card.js on WordPress
- Change button text with user name using jQuery after user login
- jQuery Plugin Uncaught TypeError: jQuery(…).slider is not a function
- Is not using admin-ajax to ajax submissions okay?
- How to use jQuery plugin
- Find the method which AJAX GET calls
- JavaScript code do not works on online server
- onclick jquery function not working in wordpress header file [duplicate]
- How can I add a new lib path without call each one on the header?
- Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user
- How to get my insert.php url in jquery?
- Modify the href attribute of tag dynamically in WordPress
- jQuery UI Tooltip position on dashicon
- JQuery toggle in Visual Composer
- AJAX Filter WHILE Loop not working WordPress
- Unable to remove jquery from header and put in before body ends
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- Calling header from JavaScript file
- Open image gallery on link click
- How to create a radio button to alt between settings in wp_options table
- Ajax not updating to database
- WordPress 404 when using AJAX to call php function
- Is there a way to move WPML scripts in footer?
- Visual editor popover or placeholder
- Add a jQuery snippet for sepcific user role
- Bootstrap with separate js File
- jQuery not working for media uploader
- wordpress ajax pagination
- WordPress AJAX load post metadata in modal
- how use php query in AJAX jquery
- jQuery plugin is loaded correctly, but does nothing
- jQuery doesn’t work in my php snippet
- Call full image url instead of stylsheet directory url in JS for Infinite Scroll Function
- Adding scripts before plugins scripts
- Jquery script with comments ID’s
- Move jQuery on *top* of footer
- jQuery.post() calling function with parameter
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Ajax Load more CPT via shortcode
- How to toggle custom WP archive list
- I can’t enqueue Suggest.js in frontend – not added
- Form not working as it should in WordPress, but in a normal HTML site it does
- Jquery code won’t run loaded from WP, but run from console
- Jquery not loading / running on WordPress home page
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- comment-reply.js disables any other form javascript
- WP Media Uploader modal conflicts with Bootstrap modal
- JQuery and Javascript to pan image
- Add a downloaded JS file to WordPress
- File not enqueueing
- Submitting my form to the database and then redirecting to payment site
- jQuery search function not running in WordPress but running locally (fiddle)
- Enqueue script, taking no effect [closed]
- Masonry – Can’t Find Variable imagesLoaded
- $_POST empty in using new php file added to theme
- How to blur the_post_thumbnail() via blur.js (jquery)?
- Refresh widget admin page resetting jQuery hidden class
- Custom button on admin page doesn’t trigger click event
- Autocomplete for titles via ajax – rework of past post away from like_escape()
- Adding text to links when not on the homepage
- how to remove/exclude html coding from json file while export?
- Slider from different widgets
- Querying posts based off a jquery datepicker
- AJAX Not Working With WordPress Database properly
- Passing variable data from external jQuery file to options.php
- WordPress and Raty.js
- JQuery Login Dropdown not functioning in theme
- Custom Javascript not working? [closed]
- How to get this jQuary script working?
- Jquery being loaded wrong
- How to call javascript function (jquery) in a shortcode?
- What to do after a wrong RewriteRule?
- JQuery is not defined but jquery script is loaded in source [closed]
- jQuery no conflict