You could count the number of items and insert </ul><ul>
after 50%.
Sample code, not tested:
if ($postslist) {
$count = 1;
if($top) echo '<h4>'.$name.'</h4>';
echo '<ul>';
foreach ( $postslist as $post ) {
echo '<li><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID)."</a></li>";
if ( 0 === $count % 10 )
echo '</ul><ul>';
$count += 1;
}
echo '</ul>';
}
And you don’t need setup_postdata($post);
here.
Related Posts:
- Adding ‘menu order’ column to custom post type admin screen
- Style custom columns in admin panels (especially to adjust column cell widths)
- How do I set the default admin sort order for a custom post type to a custom column?
- Replacing the title in admin list table
- Make custom column sortable
- How To Remove These Stuffs From Custom Post Type List Screen?
- Custom sortable columns ordered by meta-value?
- Add “Last Edited by” column to custom post type list table
- How to add custom columns to Custom Post Type admin screen
- Column sorting with emtpy meta values
- manage posts custom column is not populating data from meta boxes
- Custom admin columns for ALL custom post types
- order of date column in custom post type
- taxonomy list display custom post count
- Add custom column to custom post type overview in backend
- custom sortable column
- Nav menu of all posts in a custom post type
- Custom Post Type, Two categories, Two columns with Pagination
- Replacing the title in admin list table
- Remove Post Page “View Post” Link
- How can I add columns to custom post tables
- Custom Post Types: Custom columns with Title submenu?
- wp_list_pages doesn’t work in hierarchical custom post type
- How to show custom (checkbox) field value in admin post list?
- Adding menu_order to CPT admin page
- Custom post admin filtering by post meta (the date)
- Admin Column Text Positioning
- How do I sort a custom post type admin column using two meta keys?
- Add Post Url to Manage Edit Screen
- How to create A-Z index listing for custom post types?
- Problem adding column to WC Subscription [closed]
- how to check if custom post type column already exists?
- How to convert custom post type based list to a dropdown list?
- Adding HTML tags or css classes to admin columns
- Extending AZIndex plugin to use custom post types and custom taxonomies
- WP CPT Custom Sortable Column in Admin Dashboard Sort Order Random
- How to show first name and last name in custom post type columns
- A to Z List of Custom Post Type in three columns
- Order a custom post type admin screen by a second custom post type title
- WordPress make Grandparent and great grandparent filterable in custom columns
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Custom columns doesn’t appear in custom post type
- How can I use this code on a custom database table?
- List of all entries of custom-post-type: Add year-parameter?
- Problem with $post_id object’s property
- Pods CMS: How to add custom column to Adnvanced Content Type
- CPT Columns doesn’t show categories
- Getting post attchment URL to populate a CPT Admin Page Column
- Custom Columns for Custom Post Type Manager
- Make a custom column sortable by a value from a different custom post type
- Sorting custom post types in edit.php : Post disappear
- Custom sortable column with WPAlchemy
- Remove filter and view options from custom post type edit screen
- Sortable column with custom data by date
- Add Content Column to Custom Post Type backend
- Hide Published text from custom post types column
- custom filtering admin columns
- Custom sorting in post columns by ACF Pro Select Field
- put a list of one post type in other post type to select from it and display selected item in second post type’s single page
- Columns depending on posts count
- Making my custom column sortable
- Listing Custom Post Post from certain category
- Simple term-archive-linked Taxonomy Entry output
- Default custom column to off
- Change column of row action (Quick Edit) links in WP_List_Table
- Make custom post type column sortable
- List a custom post type’s posts ordered by nested custom taxonomy
- Create shortcode for list of custom post titles with custom fields alongside
- How to make a list of posts displaying them 5 by 5 with a “next posts” link?
- How to Create a Frontend Html-list Editable in the Backend?
- add a “list” into add meta box : problem
- set_post_thumbnail_size in percent, not pixels?
- 404 error PageNavi custom type taxonomy | wordpress
- Query for posts in 2 taxonomies
- How do I create an archive page for standard posts?
- custom taxonomy archive by year
- WordPress if in term*
- Regex with a possible hyphen
- Expose a custom field of a custom post type to the REST API
- Default text in a specific post type, but not visible?
- Woocommerce custom field search in custom post type [closed]
- Custom rewrite to fetch feed data
- Create custom post with meta field with AJAX and the WordPress REST API
- Change “empty trash” button text?
- wordpress lists similar type of posts in a custom post type
- How to Display the tag content of Custom Post?
- ACF – Retrieve custom taxonomy from a relationship field
- How is possible to know ID of taxonomy-{taxonomy}.php page for ACF fields
- Querying posts that don’t have a certain key value or don’t have the key
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- Custom post types not showing on the standard WordPress Category page
- Display Custom Post Type in divs
- Output all terms slugs for a loop filter
- Counting the number of post without custom post type
- Multiple WordPress Sites, Same Database but Filtered Content
- Display result as “prefix+ID” and show in the search result as bookcode
- Custom Post Search
- How can I get taxonomy terms and custom field values of a newly created post
- Custom content for Custom Post Type parent page?
- Custom post types with date based archive