wp_list_categories()
uses the Walker_Category
walker which applies the list_cats
filter, so a little PHP and:
function alpha_prefix_wpse_210205($cat) {
$fl = substr($cat,0,1);
$fl = strtoupper($fl);
return $fl.' '.$cat;
}
add_filter('list_cats','alpha_prefix_wpse_210205');
You will want to apply the filter just before you need it and remove it afterwards.
function show_categories_fn(){
add_filter('list_cats','alpha_prefix_wpse_210205');
$lc = wp_list_categories("echo=0&title_li");
remove_filter('list_cats','alpha_prefix_wpse_210205');
return $lc;
}
add_shortcode('show_categories', 'show_categories_fn');
Related Posts:
- How to display taxonomy terms the way they are hierarchical
- Using Orderby and meta_value_num to order numbers first then strings
- multiple orderby in pre_get_posts action
- Different post sort order within different categories
- Order get_terms() By Custom Field
- How to Change the Categories Order in the Admin Dashboard?
- get_the_terms in descending alphabetical order
- next and previous post link ordered alphabetically
- Sort posts by tags in category pages
- How to sort posts by last name (2nd word) on ONE category only?
- Order by first name
- Display all posts in category, with specific tag posts at top
- Query posts from current year
- I want to order categories based upon the latest post time
- How to alter query order direction using $query->set(‘order’, ‘ASC’); inside a pre_get_posts filter?
- the_tags() : display the tags by the order they are typed in in the backend, not alphabetically
- WordPress Ordering Problem. How to fix ordering 1-10-100 issue?
- Order posts by category name
- Taxonomy list. Order by a specific custom post type count
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- How to order posts by meta value?
- How Do I Order Posts by Modified Date? [duplicate]
- How can I set custom order use this function
- Orderby Post Views
- WP_Query order by date in meta_value
- How to order posts by alphabet with numbers at the end
- Display posts in alphabetical order for a particular category
- Best Plugin to Reorder Post Types
- Ordering system through WordPress
- Arrange posts by date in front page
- Issue with multiple orderby values
- get_query_var returns wrong default value
- Use pre_get_posts to sort meta_key by an array of values
- Allow user to set custom order to a list of custom taxonomies?
- Order posts by price
- All, published and pending order
- Show Primary Category first when I display post categories
- How to redefine the sorting of product categories by menu_order?
- Ordering posts by publish date not working?
- get_adjacent_post() returning weird results
- WooCommerce – How to show specific category first-rest of products-specific category last
- Order char by post title
- Why does pre_get_posts() return “date” as the orderby parameter for every sortable column?
- next_post_link and previous_post_link order not working properly
- Custom taxonomy/category order
- query pages by a childs publish date
- I want to display the all the posts that are inside a certain subcategory
- List posts in alphabetical order
- List most recently added posts (with a twist)
- Check post_date in pre_get_posts
- pre_get_posts shows posts in random order sometimes
- Featured-Content/Featured Posts With Random Order
- Orderby in Query Posts affected by operating system?
- Custom loop of a single category, cannot order by date. What am I missing?
- Ordering posts by title containing numbers
- How to change the order of the subcategory and category in a post?
- Stylesheet Enqueue Order and Best Practices
- How do order product categories – on a parent category page – in Woocommerce?
- wp_list_pages sort order by top nav menu order and child of
- How order posts from category by date and comment count?
- Order by ASC, DESC, Title, Date from URL on custom page template post
- Offset posts with random order
- Sort query output on taxonomy term archive by post type using pre_get_posts
- Natural sort / ordering wp_dropdown_categories
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Order WP_Query by The Order of an Array in Tax_Query
- struggling to order by title
- Order by two meta values – one is a number and the other is text
- Last post sorting get_categories
- How can I order all subcategories alphabetical independent of the parent categories?
- Sort by DESC works, ASC doesn’t?
- Shop sends Mail with order cancellation
- List of terms in alphabetical order under the respective initial letter and within columns
- Ordering terms whilst in loop
- update_post_meta saves data but does not show in Order backend
- Modifying category order
- how to complete order status automatically after paypal payment received
- Order management including recurring orders on woocommerce
- Orderby Title not working
- How to sort custom post’s category by id from the theme’s function.php?
- Sort posts by meta value with get method
- How to order custom user list columns by datetime?
- Creating a post that contains a list of other posts like a table of contents
- Want to order by Meta Values (tweaking Post Order Widget)
- Changing posts order on a page
- Ordering Subcategories
- How to order posts by parents?
- single post navigation order (NOT chronological)
- Problem with meta_value order after update
- Random order of posts on each request
- How can I make have_posts() return posts ordered DESC by id?
- Add post order like page order
- Woocommerce Pre Orders view order link wrong [closed]
- How to make WordPress orderby work with post_excerpt column?
- Woocommerce – Display product category of product in Orders page
- Orderby with menu_order and title
- Sort wordpress posts by facebook likes [closed]
- Post list category plugin alphabetical order [closed]
- Sorting by date not working?
- How to sort posts alphabetically based on a specific parent category