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
- column values not showing after merging two custom post types
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Display an authors post on a single page only when they are logged in
- How to group navigation items in the admin panel
- Hide meta box for everything BUT a certain custom post type
- Include php on a specific page template
- Create Array from custom post type to display a slider
- what custom post type this archive belongs to?
- Setting Post Title via Meta Data returns Auto-draft
- Tags not working in my custom post type
- Custom post-type metabox position
- wp_trash_post action hook with custom post type
- Not sure why this template for custom post type posts isn’t displaying anything. What’s missing?
- What’s an efficient way to change the post status of many posts at once?
- Use Pages for Custom Post Type
- Return the name of the post type
- I can’t access custom taxonomy page listing
- Is it possible to load a different sidebar in single.php based on a meta_query filter?
- How to have permalink like domain.com/term/postname?
- List Posts By Custom Taxonomy
- Can variables be used to rewrite a Custom Post Type permalink? [duplicate]
- Creating two loops based on different logic
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Filter posts by tax (dropdown) and meta value
- How do I amend form data before it is saved for a custom post type
- Archive-posttype.php isn’t loaded
- Wp Query with multiple custom tag(taxonomy) by get the terms