You can do this easily with a custom query. Try something like this (I haven’t tested this code, but it should be fine): (EDIT: Changed below to “get_the_post_thumbnail”, also added $post->ID)
<ul>
<?php
$args = array(
'cat' => '17',
'posts_per_page'=>20
);
$sponsors_query = new WP_Query( $args );
while ( $sponsors_query->have_posts() ) : $sponsors_query->the_post();
echo '<li>' . get_the_post_thumbnail($post->ID, array(50,50)) . '</li>';
endwhile;
wp_reset_postdata();
?>
</ul>
Related Posts:
- Is it bad practice to create own table for a plugin?
- WordPress 5.3 update causes media library file upload to break – Cannot convert undefined or null to object
- Why is “plugins_loaded” not called/fired?
- Publish author posts only with editor approval?
- how to change default icon of custom plugin?
- Any plugin out there that uses WP’s internal image uploader?
- Customizing subject in comment notification e-mails
- All shortcodes not working on custom theme
- How to work with Syntax Highlighter Evolved?
- WordPress Admin is displaying Not Available
- How to pass parameters (data) from plugin PHP to React
- How to remove/hide action links cluttering under specific plugins’ names
- How to create an edit media button for slideshow plugin?
- How to develop a community feature in the dashboard for multiauthor site
- Which hook should be used to validate custom form fields on the login form?
- Change Permalinks Structure to a Sequential Number for Each Post?
- Plugin child folder?
- Short code for Venues
- How would one split content of a post into pages?
- merging an array to an existing array using add_filter
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- Change wording of admin menu item?
- How to check what plugins used to be on a WordPress installation?
- How to find a run away wordpress plugin causing performance problems
- Form doesn’t submit on second submit call
- What would be the advantages/disadvantages of remote plugin installation?
- How to slice an array using posts_per_page? [closed]
- woocommerce payment gateway callback not firing [closed]
- Installing a plugin on a premium site [closed]
- Trying to create a private area custom for each user where they upload images to a server [closed]
- Facebook Messager Plugin
- How to save inputed data in a textbox [EDITED] [duplicate]
- Customization API for plugin development
- User switching only with specific role and return
- automatic plugin install availability: server configuration
- Adding Font Awesome to WP Plugin
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- Char limit on custom blog-post form? [closed]
- Is there any plugin for course management? [closed]
- w3 Total Cache not Caching – Requested URI is rejected [closed]
- Which file of wordpress manage plugins functionalities?
- Can I put in Github the code of a abandoned plugin I want to fork?
- How to use login_redirect with a user capability
- Form that generates an ID for the customer
- Passing stored variables to add_filter
- Wooslider custom css
- Ajax Plugin Not Echoing Response
- is_rtl returns false while it should return true
- How to create wordpress page that lets users create their own quiz? [closed]
- Can i legally remove a credit from a free plugin on wordpress.org? [closed]
- How to reinstate previously saved option?
- merge wordpress plugins
- quicktag breaking FancyBox plugin on my blog’s front page
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- Can’t create new CPTs when menu hidden
- Localise settings section headline
- Google Appointments in WordPress?
- How to make a Product page without ordering and database
- Codeless random token generation to pass into multiple tracking links in a single page load
- wp_options not returning value for logged out users?
- Custom WordPress feed on Apache server returning 304 response for if-modified-since
- RSS Feed on WordPress showing code (hypertext) in articles titles
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function
- Hide all Admin Notices and move on a separate page
- WordPress Gutenberg How to make TextControl Required?
- Display a number value from mysql query in WP
- Front Page of Site Has Gone Replaced By Random Page
- How to deprecate a hook used in a plugin?
- Creating categories while importing via CSV
- How can I show login popup when user clicks on download button
- Website content not displayed anymore after updates
- Flexslider empty slide
- get_permalink is causing a whitescreen
- WordPress plugin changes not updating
- Adding javascript to header of MetroMagazine theme
- How to Save settings of custom tab product page in admin side in a database?
- Issue: CSV file upload works only when “View page source” is done
- Meta box: Undefined index
- Unable to Retrieve Setting Value for my Plugin
- How to delete user meta by key
- galleria for WordPress not working properly on Mobile devices (responsive)?
- Get plugin versions in xml/json format
- Shortcode registered from a plugin not recognized
- How to use template field in the Event Organiser plugin widget
- Facebook Like Button with NextGen Gallery
- Activate plugins by a theme’s functions.php?
- Notify new post on page
- when i use wp automatic plugin post shows broken images
- iframe not showing on frontend when using a CMB2 field
- Template library for WordPress [closed]
- Is option_active_plugins actually doing anything useful?
- How to add infinite scroll to element products widget
- How can I resolve an error on WordPress after PHP update
- upload_mimes is getting ingored, how to add a new mime type?
- PHP FATAL ERROR
- Remove a specific sitemap from Sitemap_index.xml
- Testing Plugin – Install plugin dependencies in testing enviroment
- Show different page depending on user role
- Email notification when registred user clicks a link/visits page