Yes, it is quite simple, you just need to work in PHP.
Consider you have 36 posts in a loop.
$div_html_1 = '';
$div_html_2 = '';
$div_html_3 = '';
$div_html_4 = '';
$div_html_5 = '';
$div_html_6 = '';
if ( have_posts() ) {
while ( have_posts() ) {
if( category of post == division 1 ) {
$div_html_1 .= "Your HTML here";
} elseif( category of post == division 2 ) {
$div_html_2 .= "Your HTML here";
}
and so on....
}
}
And in the layout, your code would be like,
<div id="prefix_div_one">
<?php echo $div_html_1; ?>
</div>
<div id="prefix_div_two">
<?php echo $div_html_2; ?>
</div>
and so on...
Related Posts:
- Woocommerce, recognize the loop of related products
- Using Advanced Custom Fields to create a per page slider
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- For each loop will not append to the_content hook
- How to get URL of current page displayed?
- what is correct way to hook when update post
- Getting only direct child pages in WordPress with get_pages
- Query multiple custom post types in single loop
- What is This esc_html_e() i wordpress php?
- How can I fetch loop of post titles via AJAX?
- Using register_activation_hook in classes
- WordPress and event-driven programming – what is it about?
- Inject post (from specific category) between posts in Loop
- Custom plugin: Trying to show saved data on frontend
- Knowing the total number of posts before to get into the loop
- Receiving Stripe Webhooks on a wordpress website
- Remove Woocommerce product link
- get product attributes for current product and store it in a variable
- Check php version before theme activation
- Build a content and excerpt grid loop with paging and options for # of posts
- Change the footer text on the login page
- How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?
- How can I hook into and edit the text of a wp_nav_menu tag?
- How to remove a metabox from menu editor page?
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- Displaying post per day
- Check if page parent has certain template
- Multiple wp_schedule_event cron jobs in plugin cause multi-execution
- Installing wp3.2.1 on IIS; getting empty sessions
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- Guidance with The Loop for CMS
- Display only text to WordPress loop without loosing the text formatting
- How to loop over custom fields in a page template?
- Prevent publish status/date saved on transition_post_status hook
- How to add active class to custom menu using while loop and wp_list_pages
- Want to separate sections of posts. Can you restart loop?
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- MySQL query performed 4 times inside loop
- Print html when custom field has value inside while loop
- Alter secondary loop to exclude posts from current page category
- How to Remove a Filter from the Admin List Table?
- Post from one loop in different containers?
- Custom Loop Pagination on WordPress
- Specific Loop For 2 Within Each
- delete an array element when its date expires
- Two posts in same div – WP loop
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- User Defined order on get_categories?
- Hooking new functions to actions + passing parameters
- Store loop into array
- Find variables available at a given hook
- Passing data between two hooks in separate HTML requests
- Looping through WP_Post Object
- WordPress loop specific thumbnail size
- Is $hook a global variable in WordPress
- get understrap pagination to work with custom query
- Replace existing content from specific WooCommerce admin orders list column
- Using an Image Slider twice on the same page
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Executing `createimagefrompng()` from save_post hook (or equivalent hook)
- Displaying Only Certain Tags in Loop
- Easiest way to show total number of subpages
- Getting my head round WordPress filter
- Delete option value from array using update_option()
- enqueue hover function
- How To Change The Html of Products filtration sidebar in Woocommerce?
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Custom Loop through category menu to include sub categories
- How to set a custom path, for ajax image upload folder in admin?
- When would you use $_post instead of $post?
- Insert all post IDs in new database table
- Output 2 items within the Loop
- How do I display the function the_content in this loop?
- Show Custom Taxonomy Title
- How to exclude specific category from the get_the_category(); array
- Way to display “Yesterday”, “Today”
- How can i display post loop in table format?
- spliting posts into two columns
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Must Use Plugin Causing Query Error
- action hook wp_head higher priority as all other plugins/hooks
- How to get to a specific position in wp_query?
- Advanced Custom Fields: Post Object – Not returning data [closed]
- How to speed up a wordpress function with multiple loops?
- Facebook “like” open graph meta in header.php
- Custom excerpt function re-factoring
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- using add_action for a header hook that has an additional parameter
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- How to call function at the bottom of post using plugin?
- multiple if statements [closed]
- How to select WooCommerce products by post_meta and order them
- How can I add pagination and how can I change thumbnail size?
- How to Display a Single Post Excerpt
- have_posts() execution failure
- How to add a second ‘place order’ button in WooCommerce [closed]
- How does the ternary operator work in the wordpress loop post?
- $wpdb->flush(); breaks the loop