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
- Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu
- How do you use a CPT as the default home page?
- Create a custom archive page for a custom post type in a plugin
- Media library – Limit images to custom post type
- Development of a WordPress Search Plugin – Best Practices
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- echo value from ‘select’ field type into page template using cmb2?
- register_taxonomy with multiple object type and update_count_callback
- How often do you need to register_post_type?
- How to use a dedicated template for the Custom Post Type from a plugin?
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- White screen error for a custom theme
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Themes VS Plugins [duplicate]
- update a post meta from a single table cell TablePress
- Remove POST_TYPE from custom post type permalink
- How to add post_author column to custom post type
- How to register custom post types in a plugin?
- Issue to get wp_get_attachment_image with cmb2
- Can’t get order_by meta_value_num to work properly
- Is it possible to place custom post type files inside a folder in theme directory?
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Custom posts don’t work
- single-{cpt}.php ignored
- Insert and then update post_type by wp_update_post
- 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
- 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?
- Addition of custom option panel crashes Media Library & Admin Area
- Dynamic dropdown select values depending on other custom field value
- Post injections into Site Origins Page builder [closed]
- WordPress randomly shows 404 errors
- Custom Post Type slug same as page name
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- How can you use one database with multisite
- Custom post type, have only my meta boxes
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- Running a song lyrics site on WordPress
- Using page slug in wp_query
- Specify a particular page to list all custom types
- show all custom posts types in home page
- How to have permalink like domain.com/term/postname?
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- Template Hierarchy for custom post type pages
- Pagination hitting 404 page on /page/4
- Can’t delete a custom post in front end with custom role
- Add custom field to admin area witthout using a metabox
- Override Plugin Custom Post Type ‘single’ view
- Custom pages missing on “front page” setting
- Add custom columns in custom post type browse page
- Create Custom Post type that uses Page.php template
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- Accessing a protected property of a post
- Multiple archives to display parent and subcategories content
- Plain links in single-class.php and archive-class.php not working
- wordpress post_where set only for my costum post type
- Setting a homepage – doesn’t seem to work
- how can i show a google map in custom post type
- Custom post type 404 error on “default” or “numeric” permalinks
- Custom Post Type – Main page for certain posts
- Display another page / custom post type as home page
- Query when is one or several values
- WordPress custom post type as homepage with homepage url
- Set a template on a custom post in the plugin
- Simple way to hide\show an announcement (just a div) on homepage?
- Why is this function so slow?
- Permalink URL connection between two custom types
- Taxonomy counter on Taxonomy List(plugin)
- Is it possible to arrange Custom Post Types from CPTUI into a Folder?
- Restrict Custom Post Type to One Item
- Multiple useres editing specified content
- Filter Custom Post Type Posts by Taxonomy
- Add input radio menu to post
- Insert custom taxonomy into category query
- Simple Data picker meta box
- I can not call the categories of custom post type
- Link two different post using there post_id in post meta
- Custom post type that lets users create a set of posts?
- Custom Fields through plugin in a Custom Post Type
- WP_Query return highest number only
- Remove custom post type generated by a plugin (The Events Calendar) [closed]
- Show custom taxonomy not in submenu
- Loop carousel slider in wordpress
- Custom Homepage As Single Page or Custom Post Type?
- How to display custom post type in a submenu?
- Configure which plugin custom post types get registered
- How to Create Short Code Using Custom Post type
- How to manage wordpress knowledge base/wiki/posts collections
- Retrieve a post with its ACF repeater fields in wordpress