This should make you good to go:
$args = array(
'hide_empty' => FALSE,
'title_li'=> __( '' ),
'show_count'=> 1,
'echo' => 0
);
$links = wp_list_categories($args);
$links = str_replace('</a> (', '</a> <span>', $links);
$links = str_replace(')', '</span>', $links);
echo $links;
The (
and )
were in the code.
And if you only want to show 6 categories replace the $args
part with:
$args = array(
'hide_empty' => FALSE,
'title_li'=> __( '' ),
'show_count'=> 1,
'echo' => 0,
'number' => 6
);
Related Posts:
- How to include PHP files in plugins the correct way
- How Do I Use jQuery UI In My Plugin
- Checking if a file is already in the Media Library
- Prevent network activation of plugin
- How to implement add_image_size in a plugin
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- Get list of scripts / styles and show file which enqueued them
- WordPress updates defined vs add_filter?
- How to make dynamically-generated content searchable in WordPress?
- Nav Menu meta failing to import
- How can I track active users of my plugin? and why doesn’t WordPress.Org offer this?
- Custom attachments uploader code. Almost there!
- $wpdb->insert is changing a value
- What are the default WordPress password requirements?
- Can I get all options using the option group id? [closed]
- Actions or filters fired when data is saved in a custom table
- ERROR: Options page not found – saving settings page with tabs
- The plugin generated 80 characters of unexpected output!
- How to update/auto-update my private plugin? [duplicate]
- How to use WP default post list tables in a plugin?
- What’s the Right Way to get and save remote data for a Gutenberg block?
- Is there a need to do apply_filter(‘widget_title’, $instance[‘title’]) or any other ‘widget_xxx’ filters?
- Passing array of strings to a SQL statement in a WordPress plugin
- Add multiple shipping rates from add_rate function with custom ID
- Filter, or any way to dynamically change theme screenshot image?
- Sidebar widget to show popular post not working?
- WP_Query returns no results
- On Plugin Activation, How Do I Check for Proper Transport Mechanism?
- Show add_meta_box by selecting a specific category
- Can a plugin be used to contain all custom functions to extend other plugins
- How to render a time-of-day string like ’16:42′ with a site’s chosen time format?
- Are block templates incompatible with serialize_blocks?
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- Programmatically modify an admin page UI of a WordPress site from my WordPress plugin
- Will setcookie work if there is a cache plugin installed?
- Adding settings link to plugin doesn’t work
- Check Paypal Purchase is Success or Not in Easy Digital Download Plugin
- Render content after post title in wp-admin
- Error on inserting a form value to database
- Is it possible to install a theme via a plugin?
- Form doesnt save to database
- Wp_list_table search box not working for custom value from database
- Notice: Trying to get property ‘term_id’ of non-object
- Append wp_editor to Dynamically created textarea
- javascript datatables in a plugin
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- How to add user details to different tables immediately after user registration
- How to change the column label in screen options for a custom column?
- include php file if page_id matches
- captcha not working in my custom plugin
- Optimising a big WordPress site
- How do I link to a php file in my plugin directory?
- Why wp_die() doesn’t work with wp_redirect but exit() works
- Is it possible to abort post update if specific conditions on metadata are met?
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- How to create a page with a form programmatically in WP?
- Category select options for plugin settings
- why do I have to use required parametres?
- Plugin header: WP and PHP version control uses wp_die(), can I change that?
- Completely isolate a plugin view so it doesn’t load the theme
- Does is_admin() really provide a plugin performance improvement?
- Enqueueing common php scripts in a plugin
- plugin content on front-page only. Nowhere else
- get_avatar filter in WordPress 4.4, how to filter properly
- How can I save a password securely as a settings field
- How to make a cronjob type plugin
- How to localize data array in plugin’s option page
- Update plugin settings option_name for big plugin update
- Changing permalink structure breaks link to .php file which generates files dynamically
- Decontruct serialized data array from wp_options
- Upload product image from frontside for administrator only
- $wpbd->insert_id is returning null
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- Redirect WooCommerce checkout to cart
- Initializing rest endpoint issue
- Plugin Activation Causes wp_register errors
- WordPress plugin how to run function when button is clicked
- BuddyPress and namespacing
- How to get values from Tinymce visual editor popup?
- How to debug new shortcode? And how to get string from shortcode into code?
- Ajax call not working with
- plugin modal/popup integration best practice
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- From my Plugin Settings Page use check boxes to load specific css files (e.g. Bootstrap / Foundation)
- how to display my WordPress plugin on a chosen page?
- Sessions in plugin development?
- Is it possible to make WordPress as a RESTful app?
- List all content by post type
- Best Way to Grab Post ID from Plugin
- How to set/change another post author by custom fields or something else?
- Fatal error: Call to a member function query() on a non-object in my ajaxpage
- How to inject html to every page with a plugin?
- How to Pass ID through Short Code
- how can a plugin return an error message on activation?
- Declaration of mandoe_menu_walker::start_el(&$output, $item, $depth, $args) must be compatible with Walker::start_el(…)
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- How to get locale within WP REST Request?
- How to add extra EXIF data when images are uploaded?
- How to boost WP custom post REST API GET queries by custom taxonomies