Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
  • #2995

    I just installed the AVH Extended Categories plugin for use with the Habitat theme. For some reason the plugin category widgets do not display within the sidebar in the same style as Habitat’s default widgets. Any idea how I would correct this?


    Can you post a link to your website please. Maybe I can help you (even if we don’t support third party plugins officially).


    Here is the site:


    The problem is that the output of the standard category widget (which comes with WP) and your category widget is totally different. Please use another category widget because adjusting css for “AVH Extended Categories plugin” isn’t easy and takes some time.


    I’ve tried several other categories widget plugins and they all seem to suffer from the same issue. Do you know of any that would be compatible with the Habitat theme?


    Why don’t you use the standard category plugin? Do you miss some features? I can only point you to the official plugin database here: as I didn’t test category plugins myself….


    The standard category plugin doesn’t have an exclude feature which I need in order to create separate category groups. I can group them manually using the links widget, however then I lose the category count feature.

    Any ideas on how I can solve this?


    I managed to code my way towards about a 50% fix for this problem.

    [1] I need a filter function for the AVH Extended Categories widget to force the “post count” inline. Below is an example of a current filter function that I am using on the theme for the non-AVH widgets. Any idea how to convert this filter function to work for AVH extended categories widget?

    add_filter(‘wp_list_categories’, ‘cat_count_inline’);

    function cat_count_inline($links) {

    $links = str_replace(‘ (‘, ‘ (‘, $links);

    $links = str_replace(‘)’, ‘)’, $links);

    return $links;


    [2] The second issue is that I need help to extend the bottom category lines. They seem to only extend the length of the text. Any help would be much appreciated.

    You can see the site here (the two top side bar categories are the ones I’m working on):

    Once I fix this problem, I will come back and post how I did it so that others can use the info if they plan to integrate the AVH Extended Categories plugin into Habitat.


    I don’t know which variables AVH Extended Categories outputs or which functions need to be modified but with string replace you can easily remove the divs around the a href links and output the same structurecode like the standard category widget does. At the moment it looks like:

    <ul>	<li class="cat-item cat-item-11"><div class="avhec-widget-line"><a href=" (Purchase code hidden if logged out) /" title="Salt Water Taffy Breakfast Recipes">Salt Water Taffy Breakfast Recipes</a><div class="avhec-widget-count"> (1)</a></div></div>

    <li class="cat-item cat-item-1"><div class="avhec-widget-line"><a href="" title="Salt Water Taffy Recipes">Salt Water Taffy Recipes</a><div class="avhec-widget-count"> (20)</a></div></div>

    Just delete <div class="avhec-widget-count"> and <div class="avhec-widget-line"> with string replace (don’t forget the closing div tags)


    Thanks for the info. I’m not quite sure how to put your suggestion into code. I gave it a try but I seem to be doing something wrong.

    When I first installed the Habitat theme, none of the default category and archive widgets would display the “post count” inline, they instead displayed the post count on the line below (this is why I inserted the two filter functions to correct the issue). Obviously now the AVH categories plugin widget is repeating this same problem. Is it possible that the Habitat theme might have a code error somewhere that keeps causing this issue across all post counts? Or is Habitat coded in such a way that is not compatible with the post count feature?


    This problem occurs when your category names are too long. You can change the category list structure easily though. Open up style.css and replace:

    .sidebar .widget_categories li, .sidebar .widget_meta li, .sidebar .widget_archive li , .sidebar .widget_links li{


    .sidebar .widget_categories li, .sidebar .widget_meta li, .sidebar .widget_archive li , .sidebar .widget_links li{


    The code change above is already running on my site, and unfortunately doesn’t seem to affect the post count. I made it in order to change the categories from a double to a single line. Perhaps that original default “double” category line setup is somehow connected with this post count problem. I’ve had several people look at the problem, and thus far no can seem to pinpoint how to fix it.


    It’s the plugin output code. The archive count at the sidebar bottom displays fine. The problem is the div structure of the plugin. A dirty hack would be to replace (style.css):

    .widget_extended-categories a{


    .widget_extended-categories a{


    Tried out your suggestion, it does brings the post count in line, however it distorts the AVH widget bottom borders.


    Yes – that’s why I called it a dirty hack :)


    Do you think that this is a fixable problem? What would your advice be on finding a solution? I’m fairly new to the realm of WordPress, so it’s difficult for me to make an accurate assessment as to whether or not I should continue to try and find a fix.


    Yes it’s of course fixable. With some css tweaking or (better) with a string replace function you can change the output easily. It just takes some time to investigate the plugin files and to find the right variables/output functions. We don’t support third party plugins – that’s why I can’t look into it…


    Should anyone else be interested in fixing this AVH Extended Categories post count issue, simply insert the following code into functions.php.

    add_filter('wp_list_categories', 'avh_cat_count_inline');
    function avh_cat_count_inline($links) {
    $links = str_replace('<div class="avhec-widget-count"> (', '<div class="avhec-widget-count"> (', $links);
    $links = str_replace(')', ')', $links);
    return $links;


    Thanks for posting your solution here :)

Viewing 19 posts - 1 through 19 (of 19 total)

The topic ‘AVH Extended Categories Plugin – Habitat Integration Problem’ is closed to new replies.