Just before the while
loop starts, have a counter variable like
$counter = 0;
Just before the endwhile
, add the following check with counter.
if ( ++$counter == 10 )
{
$dee_output .= '</div><div class="second-half">';
}
Note: I don’t see correct number of opening and closing div
tags, so please check your code.
Related Posts:
- Retrieving 3 latest post from each of 5 different custom post types
- How do I correctly query posts from a post ID?
- How to get post content by calling ajax?
- Get the ID of the latest post
- How to get only one category of custom post type?
- Query for posts in 2 taxonomies
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Quickest way to get last or oldest post date – WP Query
- ‘category__and’ for custom taxonomy?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- Combine query_posts() and get_posts() into single query
- How to insert content from another Custom Post type into Post?
- Change or update WordPress loop based on dropdown selection
- Show a Category X’s custom post type on Category X archive page?
- Listing all term items alphabetically / sorting loop
- pagination not working for category.php (custom post types in categories)
- 3 random images from custom post type, each in a div with a diffrent class
- Control content before and after custom post type loop
- How to Make infinite loop of post
- Displaying multiple post types on home page
- Pagination not working on custom query on a page
- Loop through posts of only 2 statuses
- postsperpage value not being applied
- Query all post types but limit to parents
- 4 posts per page from single category
- Custom Post type showing up in loop, regular posts are not showing up
- Custom Post Type Query W/Category Dropdown
- Custom Post Types Not Showing Up In query_posts Result
- Modify default Related Posts Code to Custom Post Type
- Can I show some specific post rather than latest post?
- display news with pictures 3 small and one large (loop)
- How to create content automatically when a post is published?
- How to exclude certain portfolios from a loop
- Render a loop in Timber (twig for WordPress)
- Query a custom taxonomy in a function to create an csv file
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- My post loop needs to have 8 different post templates
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- minimize wp_query call to database
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Show parent category and subcategory once in while loop
- List all posts associated under custom taxonomy
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- % encoded URL giving 404 error in WordPress
- CPT: multiple loops with different terms
- Group Custom Posts Types in a Relation field of ACF
- Mix Facebook and Twitter feed into custom posts
- WordPress trying to query two custom types to get child from the parent
- Display title of all custom posts from same taxonomy term on a custom post template
- custom post type single page
- sorting in wp query based on custom field value
- How to build Custom Post Nav Menu inside of the Loop
- Use WP pagination functions on a custom page template
- week days sorting based on starting day
- Loop to display parent categories in custom taxonomy
- Getting Custom Posts with Custom Taxonomy
- Query posts based on user preferences
- Custom taxonomy template for custom fields loop [closed]
- Custom post Query and WordPress Post Query Clash
- Add active class to foundation 6 tabs while looping categories
- get_permalink() of page the enclosing page not posts
- Sort loop by custom field from different post type
- Custom post type loop without children
- Query the title of the page to show posts with matching category in the loop
- How to show terms used only for particular custom post type. Filter creation perpose
- next_posts_link() always generates second page link on custom post type
- Infinite scroll doesnt work
- Display related post content and custom field content
- Error get_posts with Custom Taxonomy and OR relation
- How to prevent post to repeat on my loop?
- update a posts of other custom post type
- Show posts for current taxonomy
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Get post from Category by Priority
- Excluding category from loop not working
- How to display user-defined / custom post in wordpress?
- 2 custom posts types, in their own columns, one pagination for both
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- Fetch loop of custom post types with AJAX
- Custom post types not displaying per category
- How can you use a page for a custom post type?
- Only show current category post
- How to make a shortcode for my WP_Query Loop? [duplicate]
- How to Create movie schedule by custom post type query
- Error in WP Query. If variable is empty it is displaying previous post value
- Strange behavior on WP_query
- Looping through custom taxonomy in one template
- get_post_meta for Custom Post Type ( CPT )
- WordPress loop, show only one post per custom field
- How to return custom posts in loop?
- How do I get the posts from single page custom post type from a sidebar to display in a page?
- All custom posts are not showing up
- WordPress query posts by custom post type not workng
- Main site single-property.php design, as homepage of a multisite
- Running get_posts within get_posts to get children of children
- WordPress get all post with like in terms [duplicate]