"All" Filter

This topic contains 3 replies, has 2 voices, and was last updated by  satori 3 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3809

    achamlin
    Participant

    Hi Andrii,
    Is there a way to get ride of the “all” filter that appears automatically so that the portfolio page may open up directly onto one of the filters I have created?
    Thanks!
    Dan

    #3816

    satori
    Member

    Hey Dan,

    Getting rid of the “All” button is easy – please use this CSS (you can paste it into the “Style: Add Custom CSS” tab of the Theme Options panel):

    #portfolio-filter-item-all { display: none; }
    

    Telling the page to filter the results by default is trickier – you will need to include some custom jQuery, something along the lines of this, which will need to go into the “header-functions.php” theme file. You will need to replace the “XX” with the name slug of the portfolio tag that you wish to use as the default filter.

    Sincerely,
    Andrii / Satori Studio

    #3818

    achamlin
    Participant

    Hi Andrii thanks for your help! So I was easily able to remove the “all” using your line of code, but I see that it still opens to all, just without the filter. The jQuery you gave be didn’t seem to work, it just got rid of all the projects. If you think this is too complicated to explain, then would it at least be possible to set the types to not order alphabetically somehow but by an order of my choosing from left to right?
    Thanks again,
    Dan

    #3822

    satori
    Member

    Hey Dan,

    this hasn’t been envisaged as a back-end feature, yet you can change the order by altering the get_terms query on line 49 of the “page_portfolio.php” template file – from:

    $kanso_sd_portfolio_types = get_terms('tagportfolio');
    

    to (for example):

    $kanso_sd_portfolio_types = get_terms('tagportfolio', 'orderby=count');
    

    this will order the terms by the number of items in each tag; other options available in WordPress include ordering by term id (replace “count” with “id”) and alphabetic ordering by term slug (replace “count” with “slug”).

    Sincerely,
    Andrii / Satori Studio

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

You must be logged in to reply to this topic.