You’ll want to move the row/columns inside the loop to do this. Perhaps even inside the template part. Seeing as I don’t know what’s in there, I’d suggest this: (notice I corrected your missing ” at the end of div classes and added php start/stop)
<div class="row">
<?php
/* Start the Loop */
while (have_posts()) : the_post();
echo '<div class="col-md-4">';
get_template_part('template-parts/post/content', get_post_format());
echo '</div>';
endwhile; // End of the loop.
?>
</div>
this is fine if there are only 4 items in your row. or your system handles row calculations for you. If it doesn’t you’ll need to move the row call into the loop as well and add item count and then if statements for the 1st and every 4th item after that.
Related Posts:
- Advanced search form with filters for custom taxonomies and custom fields
- WordPress 3.3 custom post type with /%postname%/ permastruct?
- Show Custom Taxonomy Inside Custom Menu
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- Have different search results template depending of custom post type searched
- Why does a custom post type need the ”hierarchical’ args setting?
- How do I programmatically add items of content to a custom post type?
- order by meta_value serialized array
- bulk Update post_meta with default values
- WP_Query pagination using only numbers instead of /page/1 on URL
- How do I set the content for a post of a particular CPT?
- Uploaded image not appearing in custom post type
- Output the slug and name of a CPT single post taxonomy term
- Slug for standard post post_type
- Paginate_links links not working accordingly to how I do query the page
- Parent page using wp_dropdown_pages and multiple post types
- Query for custom post type objects in a taxonomy and with a meta value
- Get post type from taxonomy or category page
- Add nonexisting pages to navigation
- How to add plugin custom field to custom post type?
- Multiple post type queries (with specific arguments for each)
- Is it possible to create a post using a metabox?
- Custom Post Type and Labels
- related posts – pulling tags from a specific post type
- WP 3.0.5 – Custom posts matching 2 taxonomies
- Custom Post Type Loop within Shortcode
- How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- How to add post_type=value when editing that post type in the WordPress admin?
- Change archive page template using pre_get_post
- Force documents to appear in Featured Image dialogue
- Custom post type redirected to homepage – how to debug
- Filtering WP_Query Dynamically on the Front-End
- How to retain $_POST data when submitting form to custom page
- Query with no terms uses index.php template instead of archive.php
- custom taxonamy and post type
- retrieve Meta field value from CPT and set those values as Image Meta Field “Title”
- Taxonomy custom post type URL
- Custom post type archive page – Posts overview – with one modal for multiple posts?
- Getting categories of posts under a custom taxonomy
- How do I display the taxonomy for a custom post type in an array
- Is it possible to to use custom post type types on a page with the same slug somehow?
- WordPress custom post query with pagination
- Custom Post Fields at the beginning of a Custom Permalink
- Add term to custom post type on draft
- When an unregistered user submits a form for a custom post type, send an email that lets them delete their post
- Multiple tag cloud filtering
- add_rewrite_rule and passing variables for custom post types
- Possible to filter custom post type with multiple meta data?
- Best way to organize book-page structure
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom templates for a specific category
- Three Most Recent Posts, One Per Term
- Show all tags on custom post type
- show custom value from frontend form in a post (custom post type)
- How to automatic update date and time when save custom post type
- get_the_tag_list() returns bad links
- Filter second dropdown (tax) based on first dropdown (cpt)
- Excluding a Custom Post Type with a specific tag using pre_get_posts
- Merge page with custom post type
- Inefficient Query Confusion
- Display an icon based on post type
- What is the diference between Post Metadata and Queried Object
- REST filters only firing when I have a param set
- WordPress custom post type and taxonomies
- Search for dates on custom post types
- list posts of two post types in a single template
- Taxonomies exists – but not showing up
- Multiple post types for BuddyBlog plugin [closed]
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Conflict in function to allow single post template based on category
- Find Posts based on Child Post value
- How to display “Trash” in my custom post type?
- Sort custom posts by date and then by taxonomy
- Add a form in every post and save data in post meta
- Display CPT Category List as Shortcode
- Custom post type sortable columns when column value is from a custom database value
- Plugin Development using classes – Public & Private Callbacks
- Correct way adding External classes to Custom Post type and output their methods to template
- Linking WordPress Post Types to Another
- Migration in new Custom-Post-Type-Structure
- Get posts in custom post type categories
- Post display in separate page [duplicate]
- Create dynamic logo carousel without using any plugin
- Delete Post by User
- Only show current category post
- WordPress Contents Migration
- Custom post type translation
- Test for post type in request filter?
- Have two (permalinks) urls for a same custom post type
- If taxonomy show class of active
- Query Posts From Multiple Post Types
- Custom Post Type Permalinks Problem
- Custom Post Types (Changing post style based on category)
- How to loop through custom posts in admin edit screen
- Notices when submitting custom post type from front-end
- querying to custom field over ACF REST API
- Fatal Error WordPress Custom Post Type UI + WPML
- How to add categories to a custom post type using wp_insert_post($new_post);