I’m not familiar with MultiPostThumbnails, but I suspect your problem is:
$flexID = $my_posts->ID;
That code appears to be trying to get the ID of the WP_Query object itself. I don’t think that exists. Even if it does, it won’t do you much good.
Rather, use this:
$flexID = get_the_ID();
That code gets the ID of the current post in the loop.
In general, make sure to review the WP_Query codex page. You can tighten things up quite a bit. For instance, your whole query can be on one line:
$my_posts = new WP_Query( 'post_type=slider-image' );
Related Posts:
- Creating two database tables via plugin
- Query Posts by Custom Field ‘Price’
- How use %like% in sql statement wordpress
- Accessing GET variable named ‘error’
- WP_Query ordering numbers as letters
- AJAX search posts and pages
- how to use in custom single.php template using php?
- How to create a custom shortcode based on the layout?
- Redirect to another page using contact form 7? [closed]
- Delete data from custom table when deleting a post
- How to Join wp_posts & wp_postmeta table using custom query
- adding dynamic/multiple slug values in ‘option_none_value’
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- How to use information from the database in the front-end?
- How to insert variable which contain array value in wp_options table?
- Shortcode in a blog post, footer and related products stop working
- WP-Snap too slow (caused by WP_Query?)
- WordPress Meta Query: Relation is not working correctly
- Making a Custom Post Type Publish Loop
- Checking url from plugin [duplicate]
- Accessing Correct Database to Create REST API Endpoint
- Does a plugin’s “main” file need to be named the same as the folder containing it?
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- Customizing subject in comment notification e-mails
- enqueue script only if it is not already enqueue
- Add content to /wp-admin/plugin-install.php admin screens
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- How to extract images of post and pages excluding header and logo image in wordpress?
- Plugin child folder?
- merging an array to an existing array using add_filter
- How do I store information in a dynamic block in WordPress?
- Is it possible to set up multistore in Woocommerce? [closed]
- Retrieving plugin options value saved through setting
- How to generate video out of images via WordPress plugin
- How to slice an array using posts_per_page? [closed]
- Get plugin option in another PHP file
- Help With MySQL to WPDB Query Conversion
- __callStatic method handler passed to add_action causes bug in PHP
- code is working properly in Core PHP but writing coding in WordPress
- New databes tables with – WooCommerce – for developers [closed]
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- Perform internal redirect in WordPress?
- Using AJAX to generate front end / viewer end pages
- How to prevent plugins from loading jQuery
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Disable Individual Plugins (specifically in Custom Post Types) on a per-post basis?
- Basic question about accessing scripts in my plugin
- Automatically download, install and activate plugins that my plugin depends, how?
- Error in pdf generating plugin using FPDF
- How to create WordPress custom end point with multiple parameters?
- How to redirect to same page after form submission
- plugin dev – minimum base css specificity?
- Loop in elementor custom widget not working
- WordPress SVN UTF-8 issue
- Asynchronous request in wordpress
- Loop returns the current page’s permalink and guid instead of the post in the loop
- How to access OOP plugin function inside themes or other plugin
- change or add css to theme from plugin
- Displaying data from another database
- Every time I de-activate a custom plugin, the site encounters a critical error
- Custom Fields for Page Edits
- Apply html elements in php statement
- How to find the WordPress Nextgen galleries which are not used in WordPress posts?
- How to make sure settings are not lost when plugin is updated?
- How Can i import plugin option?
- How to Get Category Name When Export Products
- How to override any plugin file in the child theme
- Custom plugin activation error
- How can I translate something in my class constructor of my plugin in WordPress?
- Define global variable in theme file and call that variable in plugin file
- How to capture hidden values with Gravity Forms
- Custom Plugin Update
- How do I stop plugins and themes from getting updated in a new plugin?
- How come W3TC is allowed to host premium code in the WordPress repo?
- Multiple image selection custom widget
- Passing function into add_action always returns the first argument
- Paid Membership Pro displaying a user name in PHP
- Make another copy of a plugin and install it
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Creating Nested custom fields
- plugin not hooking to my custom hook
- Populate select option with JSON file
- Enahanced search for edit.php and custom post type
- API Functions to Register and Show WordPress List Tables
- How to save default values into an option and delete those upon actvation and deactivation in wordpress?
- How to Add Jquery FullCalendar in wp plugin in admin
- Plugin does not create a custom table upon activation
- Ajax, jQuery and WordPress
- How to get site homepage from plugin?
- Unable to show 4 products in a row
- WordPress check box unchecked on null value ternary operator [plugin development]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- wordpress Ajax success doesn’t return the value
- WP Elementor Pro causing crtical failure on website
- Function not being called on form submit, only blank admin-post.php page
- How to give specific class name to category in wordpress with code snippets
- Display Any Field fromAdmin Panel in Frontend via Shortcode?