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

    Hello,

    How can I hide the “All” category when using a sortable accordion and default the sorting to one of the other tags?

    Thanx!

    #133935

    Open up wp-contentthemesenfoldconfig-templatebuilderavia-shortcodestoggles.php and delete following line to remove the “All” link:

    avia_sc_toggle::$tags = $start + avia_sc_toggle::$tags;

    Unfortunately it’s not possible to pre-select another sort option and the items would be unsorted/unfiltered even if you remove the “All” link.

    #133936

    So . . . editing the above will do what exactly? Just remove the “All” option in a sortable list? But then, are you saying the list will no longer have ANY sorting options?

    While I understand there’s no “simple” way to remove “All” and default to another category, there has to be SOME kind of way to do this. Could you point me in the right direction? Maybe some kind of javascript that reloads the page with one of the other categories “clicked”. Any direction you could provide would be great. Thanx!

    #133937

    As a workaround I’ve changed the term “All” to “General Questions” though this is not ideal, and I would still appreciate input on my questions above.

    For sake of anyone else seeking to do the same, alter the strings in the following two lines. NOTE : At first I just changed one, and it changed visuals but broke the functionality, so make sure to change both. Line 215 and 245 in toggles.php.

    $tag_string = "{".__('All','avia_framework' )."} ";<br />
    $start = array(__('All','avia_framework' ) => true);<br />

    #133938

    Hey!

    Unfortunately at this point its indeed not possible to set the default filter to a category of your choice. One of the later updates added an easier way to edit the “All” Keyword however.

    you can add this to your themes (or better: child themes) function.php file:


    add_filter('avf_portfolio_sort_first_label','avia_change_label');

    function avia_change_label()
    {
    return "Name of your label";
    }

    I will see if there is an easy option to set a default category without rewriting too much of the theme code…

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Accordion : Hide "All" Category’ is closed to new replies.