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)
- How do you get the count of posts in an archive page?
- List most recent image uploads, but only for specific custom post type
- Get all authors with at least one post of ‘custom post type’
- How to get the parent’s taxonomy?
- Post Loop not Returning Permalink
- ascending order custom post type
- Get random custom posts from a custom post type
- How to display recent posts added in several custom post types
- Posts navigation in custom post type single.php not working
- Remove duplicated values from a loop
- How to connect two custom post types with nested loops
- Custom Post Type Loop throws 500 error when used in widget
- Query/list all terms and their custom post count
- get custom post type
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Display Custom Taxonomy Alphabetically
- Problem: wp_query outputs all images on site
- Custom Post Types strange pagination problem
- Display related custom taxonomy posts in sidebar
- How to display Related Posts based on number of taxonomy terms matched
- Conditional for a Single Post That Belongs to a Category?
- How to limit post per page of custom post type?
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- populate array with posts
- Listing custom post types on archive page with array
- looping though custom post types and only return results in a given taxonomy
- How to conditionally add Custom Post Type to Front Page
- Is it possible to use array_walk() to append terms to an array of posts?
- get custom post type value in header.php [closed]
- Best way to create a search for custom post type by custom field values
- HM CMB: Post Select Field for CPT ID
- pre_get_posts works in post type archive but not in single post
- Display Posts Query with IF function
- How can i loop through custom post type according to custom meta field?
- Changing WordPress sort order for returned child pages
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- Filtering posts based on three taxonomies
- Get all posts by many custom post types
- Add extra elements to the_post in a custom post_type
- Custom Post Type has wrong label and is not found when called by a loop
- Order Posts in Custom Order
- Error in the page of a CPT file in WordPress
- 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
- 2 custom posts types, in their own columns, one pagination for both
- Main site single-property.php design, as homepage of a multisite
- Decrement term in for each
- Pagination on custom post types
- How to get past and upcoming post by defining date in custom field?
- How to query all custom posts of a certain type and checking what category they have
- Post data in separate divs with incrementing class using WP_Query
- Redirection loop error after login from a custom post type post
- How can I give WordPress child custom post type the same title and slug as its parent?
- Post_type doesn’t work for widgets?
- display custom post type from register taxonomy
- Custom post type and have_posts() return empty result
- why does my post loop break the page?
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Filter page ID outside the loop and order
- How can I show posts with the same tag?
- WordPress post objects in one parent post object