New Front EN › Support Forums › Kanso Theme Support › "All" Filter
- This topic has 3 replies, 2 voices, and was last updated 9 years, 4 months ago by
satori.
-
AuthorPosts
-
July 28, 2014 at 2:25 am #3809
achamlin
ParticipantHi 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!
DanJuly 30, 2014 at 12:46 pm #3816satori
KeymasterHey 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 StudioJuly 30, 2014 at 8:13 pm #3818achamlin
ParticipantHi 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,
DanJuly 31, 2014 at 9:16 am #3822satori
KeymasterHey 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 -
AuthorPosts
- You must be logged in to reply to this topic.