Rewriting Codex examples in Child Theme functions.php
-
This is probably really simple… but i’m just having trouble figuring out how to rewrite the below example taken from the Codex:
EXAMPLE:
Remove Parentheses from Category Counts
When show_count=1, each category count is surrounded by parentheses. In order to remove the parentheses without modifying core WordPress files, use the following code.
<?php $variable = wp_list_categories('echo=0&show_count=1&title_li=<h2>Categories</h2>'); $variable = str_replace(array('(',')'), '', $variable); echo $variable; ?>MY UNDERSTANDING
so as i understand it I need to try to write a function something like this (or am i way off)?function XXXXXXXX { $variable = wp_list_categories('echo=0&show_count=1&title_li=<h2>Categories</h2>'); $variable = str_replace(array('(',')'), '', $variable); echo $variable; } add_filter ('wp_list_categories,'XXXXXXXXX");thanks for any help!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Rewriting Codex examples in Child Theme functions.php’ is closed to new replies.