st3vi3
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Remove Post Count Parentheses From Widgetalchymyth
THANK YOU SO MUCH!hmmm *wonders why it is $links and not $variable*
– how does one know what parameter to pick?!php nube here 🙁
Forum: Fixing WordPress
In reply to: Remove Post Count Parentheses From Widgetwould love to know this too – i have searched and search
i managed to do this with the wp_categories_list in my child theme as follows:
// remove parentheses from category list and add span class to post count function categories_postcount_filter ($variable) { $variable = str_replace('(', '<span class="post-count"> ', $variable); $variable = str_replace(')', ' </span>', $variable); return $variable; } add_filter('wp_list_categories','categories_postcount_filter');alas replacing wp_list_categories with wp_get_archives has no impact.
Anyone any ideas?
Forum: Fixing WordPress
In reply to: Rewriting Codex examples in Child Theme functions.phpthe css is as follows
.post-count {position: relative; float: right; padding-right: 8px;}Forum: Fixing WordPress
In reply to: Rewriting Codex examples in Child Theme functions.phpha – so i managed to find the solution
okay – so
if you are using a child theme – and filtering through your functions.php document this code will allow you to remove the parentheses from the post count in the wp_categories_listand it will also add a class “post-count” which can then be used in your style.css to re-align the count
function mam_list_categories_filter ($variable) {
$variable = str_replace(‘(‘, ‘<span class=”post-count”> ‘, $variable);
$variable = str_replace(‘)’, ‘ </span>’, $variable);
return $variable;
}
add_filter(‘wp_list_categories’,’mam_list_categories_filter’);Forum: Fixing WordPress
In reply to: Rewriting Codex examples in Child Theme functions.phphey
thank you so much… worked perfect!
now i know i need to get to exploring parameters some more.
just one more thing… how could i add a style within this function
basically to right justify the post counts?Many many thanks!