D
D
Dima2018-02-21 18:02:06
WordPress
Dima, 2018-02-21 18:02:06

How to remove brackets in post_count?

There is a widget for tags and archives. In the widget panel, I checked the "Show the number of entries" checkbox. But it shows with brackets
5a8d89bd33a68774279810.png
How can I remove them? There is such a solution, but I did not really understand how to apply it.
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
imdeveloper, 2018-02-21
@qpz

You need to remove the categories widget in the widgets and instead put the HTML content or text widget in its place (sorry, I don’t remember the exact name of it). Go from Design to Text tab and paste this code:

<?php
    $variable = wp_list_categories('echo=0&show_count=1&title_li=<h3>Рубрики</h3>');
    $variable = str_replace(array('(',')'), '', $variable);
    echo $variable;
?>

But most likely it will not work right away, because widgets do not process php code by default. Then install a plugin that allows you to write php code in widgets and paste the code above. This plugin is easy to find

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question