You’re passing bad array keys to $args. Do something like this:
$args = array(
'posts_per_page' => '12',
'product_cat' => 'lead-generation',
'post_type' => 'product',
'orderby' => 'title',
);
$query = new WP_Query( $args );
if( $query->have_posts()) : while( $query->have_posts() ) : $query->the_post();
the_post_thumbnail('full');
//want to display the thumbnail
endwhile;
endif;
There is no per_page key, use posts_per_page instead.
Woocommerce category taxonomy slug is ‘product_cat’. The ‘category_name’ is for normals posts. You must target the post type of woocommerce, here it is product.
Related Posts:
- Overriding Parent Theme… will cause plugins failure?
- Is there a way to figure out which action/filter invoked a function?
- Disabling plugin but wpenqueue is not available
- WP-TweetButton is not displaying the tweet button if this is set to “Manual.” [closed]
- Allow customers to download updated versions of software
- How to extract data from ‘edit my profile’ page in WordPress?
- Need to show featured service boxes on my company website
- Plugin retrieving results even after uninstallation
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Edit / Change Jetpack Mobile Theme [closed]
- Are links allowed in the Upgrade Notice section of a plugin’s readme.txt file?
- Use conditional logic for woocommerce variable product
- How to set category correctly for a custom post created by a remote API call?
- Order posts by meta key ( Using ACF )
- Translation issue with global variables
- How to redirect non www to www? [closed]
- Get param from shortcode in plugin function
- The correct way to handle GET or POST requests in the admin panel
- Object Caching Plugin force every plugin to cache objects?
- How to find the Registration page
- How to add category and subcategory in WordPress custom code?
- Plugin not working locally, but works on server
- Conditional custom redirect
- Customizing $product->get_title() function
- Role based permission edit for plugins
- Portfolio Slideshow Sliders Behaving Oddly When in jQuery Ui Tabs
- Can’t create tables with my plugin
- How to add an admin alert for missing plugins
- Looking for a simple checkout plugin [closed]
- Link Posts to External URL
- to show image in large size with fancybox
- Specific plugin for custom user information access? [closed]
- Pasting this PHP breaks my page. Why?
- using wp_cache in plugin
- Check against server time to display SQL entries – Radio Station DJ Rotator Plugin
- Help understanding dynamic endpoints based on where a shortcode is used
- How can i call a functions.php function, from inside my plugin class?
- Dotenv file in custom plugin
- Bulk Image Resize for Media Library, but for ENLARGING instead of Shrinking
- How can I disable new plugin and theme install, but allow updates?
- Dynamic URL Issue on SEO Scan
- Auto delete empty posts
- Trigger popup on publish post
- Problem with MEMCACHE and Redis with wp_options
- WordPress built-in compression of images? How well does it compare to Photoshop or Shortpixel?
- Getting the same post on my related post
- Issues With Exporting & Importing Oxygen Builder Site
- How can I find related learndash course id from woocommerce product object?
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- i create functions.php in plugin files but add_action (‘wp_head’, ‘function_name’) don’t work
- How to create a custom block in Gutenberg with multiple checkboxes?
- How to use Datatable with Ajax when creating plugin on WordPress?
- why is my wordpress not loading any images?
- why is sportspress asking for FTP credentials on a local installation?
- Facebook sharing image error with facebook debug
- plugins_url not returning correct directory
- WordPress custom blockquote with black background & white text?
- WP options plugin setting not saving the selected checkboxes
- Ajax response returns html code instead of user data
- Nested Accordian FAQ
- How to get post that has non zero or greater than zero meta value
- Registered sidebar area is not shown from plugin.
- wp-settings error because of dp.php
- How do I change a plugin language of only one page?
- Building a Article Library within WP?
- What is the best practice for making a WP plugin that I want to develop responsive?
- Unable to find PHPUnit code coverage stats
- Add Filter to get_next_posts_link
- Plugin Works, but Widget Doesn’t
- Retrieve data from multiple WordPress sites using PHP script
- WordPress Plugin Localization
- wordpress title and category as result
- echo product-name in a link
- CSV file header
- How to use wp_http with https-pages?
- wordpress gallery plugin won’t show gallery online
- How to activate/deactivate menu tab and keep the same id?
- How to display a sitmap horizontally? [closed]
- Creating a custom page & output on a Plugin
- WP Super Cache versus W3 Total Cache [closed]
- Change the behaviour of archive cpt category and single cpt by plugin, not by theme
- do_shortcodes() isn’t working
- Plugin Recommendation for selling one page content [closed]
- A plugin for software reviews site like this one?
- WordPress – connection information
- WordPress Plugin for Maps of specific Tweets? [closed]
- WordPress: code structure
- Need a Plugin to create a registration form for my website? [closed]
- ACF Plugin WP with list-group – Vimeo [closed]
- How can i display portfolio images in WordPress?
- How to use Virtual Private Server as WordPress Image CDN
- Custom priority with the_content filter based on user input
- Links not opening as they should. Custom WP plugin
- Deactivated a plugin with a filter, but it still enqueues JS files
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- How to fix template and image buffering issues on website [closed]
- WooCommerce Attribute Mapping
- Create index for own custom data in elasticpress from wordpress plugin
- Dropdown menu only appearing when logged in
- Hide attributes based on previous selection