Here’s a product loop I found:
<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 12
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
woocommerce_get_template_part( 'content', 'product' );
endwhile;
} else {
echo __( 'No products found' );
}
wp_reset_postdata();
?>
</ul><!--/.products-->
Maybe that will help.
Related Posts:
- Hide Meta Boxes for Non-Admins
- Adding custom image sizes and post types to a plugin or to a theme?
- Create a simple Testimonial page
- Methods for development wordpress themes [closed]
- Can I assign a theme to a custom post type?
- Adding CPT changes entire layout of my site except for the archive of that CPT
- GravityForm: Populate Dropdown with custom post type [closed]
- how to add extra meta box or textarea into custom post types
- Pre_get_posts filter overwrites all search functionality
- “add_post_type_support” with Custom Post Type & ACF
- Shortcode insertion in tab
- Can’t get order_by meta_value_num to work properly
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Is it possible to place custom post type files inside a folder in theme directory?
- Add CPT as subpage under custom page
- WooCommerce product search titles only
- check if post title in a custom post type exists in page
- Notice: Undefined index: suppress_filters
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- How to hack YARPP plugin to find related posts for custom post type?
- Custom template with CPT doesn’t display on frontend
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Update menu when saving settings
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Create a wordpress test-system as a clone from productive system
- custom post type not showing in menu
- Custom posts don’t work
- How to retain $_POST data when submitting form to custom page
- Why get_posts() not returning only selected category posts from Custom Post Type?
- single-{cpt}.php ignored
- If post has custom field then display css-class
- Adding a custom post type taxonomy template in plugin
- Replace text in post from cvs
- Insert and then update post_type by wp_update_post
- Custom post type is showing custom home page, not archive page
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- add category name to permalinks on product page /category-name/product-name
- How can I make a custom post type sticky?
- Get term name and term parent into custom post type permalink
- custom home page and custom index page?
- Action or Filter Hook for a Custom Importer
- How to set a CPT to have a page as a parent, then rewrite urls accordingly?
- Broken featured images are uploading from frontend
- Addition of custom option panel crashes Media Library & Admin Area
- limit value taxonomy based on previous taxonomy value wordpress
- Dynamic dropdown select values depending on other custom field value
- Tracking changes in admin-page so user gets warning when leaving the page
- How to change wp prefix for custom post type only?
- Send notifications to custom post author when custom post is edited
- Metabox not show in categories custom post type cmb2
- What is the best practice for displaying my plugin content in themes?
- Post injections into Site Origins Page builder [closed]
- Custom Post Type + Categories
- WordPress randomly shows 404 errors
- Static page determines as home, but it is not
- Custom Post Type slug same as page name
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Custom Post Type within the Loop on Homepage (Page Template)
- Shortcode for CPT post content in a page
- custom post type and non-standard gallery
- Make a custom_post translatable
- How to change permalink to include custom post type
- How to Add multiple instance of meta box to custom post type
- How can you use one database with multisite
- Migrating a taxonomy’s tags to the native category
- Want to be able to sign up subscribers as authors
- How do I set a custom page template for a custom post type?
- Custom fields for custom post type
- Custom Post Archive is not working
- How to add multiple images to a custom post type without plugin [closed]
- To use custom post types, or not to use
- Unable to set featured image
- Autocomplete or suggest from post titles inside plugin
- Show all tags on custom post type
- Is it possible to show multiple (custom) post types at the wp homepage only by using pluging code?
- How to hook WP initialization without modifying functions.php
- How to create multiple editor?
- Custom post type, have only my meta boxes
- Add categories to a page with out using Custom Post Types
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- ACF in wordpress
- Create metaboxes based on custom post type
- How can I have different content for different countries?
- Running a song lyrics site on WordPress
- Using page slug in wp_query
- Specify a particular page to list all custom types
- post_parent in custom post type
- uploading problem of wordpress theme
- show all custom posts types in home page
- How to have permalink like domain.com/term/postname?
- Page Template Dropdown For Custom Post Types
- Custom post types problem
- Pods CMS: How to add custom column to Adnvanced Content Type
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- why post_class() function apply css classes to all other files?
- Template Hierarchy for custom post type pages
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Pagination hitting 404 page on /page/4
- Custom post type’s posts are not showing anywere but in xml sitemap