Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23464

    I have the following portfolio structure:

    Cat. 1

    – Sub Cat. 1

    Cat. 2

    – Sub Cat. 2

    I have a portfolio item which is part of Cat. 1 and Sub Cat. 1

    When i create a page with Cat. 1 and Cat. 2 with filtering, the filter should only show Cat. 1 and Cat. 2 as options but it also shows Sub Cat. 1. I tried everything but if an item is part of two or more categories, all of these categories are shown as filter even if i only select one for the portfolio page.

    #119919

    Open up wp-contentthemesenfoldconfig-templatebuilderavia-shortcodesportfolio.php and replace:

    if(in_array($category->term_id, $current_page_cats, true))

    with

    if(in_array($category->term_id, $current_page_cats, true) && !(in_array($category->category_parent, $current_page_cats, true)))

    #119920

    Thanks, but this is not working. Now the top cat. will be shown everytime even if i only select the sub categories for the portfolio grid. I only want the for the grid selected categories to be shown as filter options.

    #119921

    Ah, ok – didn’t understand it properly the first time. In this case revert the change and replace:

    $output = "<div class='sort_width_container' ><div id='js_sort_items' >";

    with:

    $display_cats = is_array($params['categories']) ? $params['categories'] : explode(',',$params['categories']);
    $output = "<div class='sort_width_container' ><div id='js_sort_items' >";

    and

    if(in_array($category->term_id, $current_page_cats, true))

    with

    if(in_array($category->term_id, $display_cats, true))

    I’ll mark this thread for Kriesi because imo it makes more sense to show just the selected cats in the filter bar.

    #119922

    Hi!

    Sounds logical. Will modify the function a little bit and add it to the next update :)

    Best regards,

    Kriesi

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Problem with portfolio filter’ is closed to new replies.