“Remove number of items for portfolio [ in brackets (n) ]”

  • Limbus
    Hi Ruben,

    Great theme, like it very much! I followed your tutorial on setting up the theme and already did quite a few tweaks to css and php files, but I can't find a certain line of code which I would like removed. It should be located in one of .php files, but I need your help.

    I have the works arranged in portfolios. The web site I'm working on is for a painter, so my classifications are not e.g. "print", "online", etc, but they're describing this painters cycles of work, and therefor I would like the numbers of works (in brackets) next to these categories removed from the main menu, because they always show "(1)".

    Please take a look at the attached screenshot, I believe everything will be clear.

    Best regards,

    Ivo
    Attached Files:removeNum.jpg

    11:33 on December 10, 2012

  • Ruben Bristian
    Inside the functions.php file, delete everything between lines 494 - 499: $item_output .= ($item->object == 'category' ? ' ('. get_category($item->object_id)->count . ')' : '');
    $item_output .= ($item->object == 'portfolio_category' ? ' ('. $portfolio_count . ')' : '');
    $item_output .= ($item->object == 'gallery_category' ? ' ('. $gallery_count . ')' : '');
    $item_output .= ($item->attr_title == 'allblog' ? ' ('. wp_count_posts()->publish . ')' : '');
    $item_output .= ($item->attr_title == 'allportfolio' ? ' ('. wp_count_posts('portfolio')->publish . ')' : '');
    $item_output .= ($item->attr_title == 'allgallery' ? ' ('. wp_count_posts('gallery')->publish . ')' : '');

    11:33 on December 11, 2012

  • Stacy Kvernmo
    But how would you do this if you are using a child theme? Because it defaults to the parent theme if these lines are missing, right?

    11:33 on January 2, 2013

  • Ruben Bristian
    You have to put the header.php file, modify the menu walker and create also a functions.php file with the new walker.. All in the child theme..

    11:33 on January 3, 2013

Updating...