Can anyone help me make sense of the javascript/jQuery (and black magic?) behind the category list in the portfolio of this Wordpress theme?
I recently purchased
this Wordpress theme. I have been happy so far, but I have been trying to make sense of the portfolio thumbnails view found
HERE.
Now, I don't have a lot of experience coding or doing this sort of thing, so I have spent days doing my own sort of trial-and-error editing of these templates. The developer has actually been helpful, but I think I may be asking him a bit too much with this.
Basically, I can't really understand how the list of categories in the sidebar on the right is generated, and how I can edit it. The actual template uses a separate js file, much like I found in
this example online. The demo site, however, seems closer to
this.
In the demo, the list appears once the page loads in the area after the div named "filter_work" (in other words, that unordered list happens through the scripting).
The javascript that seems to be making this whole magic list appear seems to start after the variable "filterType" is declared.
In both instances, the list of categories on the right is created dynamically as the various portfolio items are generated, then the list just sorta pops up in the end. My problem is that it seems like the list of categories just pop in using the order they come up -- there is no way to set the order in advance, and it doesn't show the parent-child relationships of the categories.
I would love if I could have my list look something like:
Fruit
_Apples
_Bananas
_Oranges
Vegetables
_Carrots
_Peas
_Spinach
I get that the current method is extensible, and will populate with new categories. I would love to keep it that way with the formatting above, but I would be willing to even hard code it in if I could have that kind of formatting instead.
However, given my limited grasp of how this whole thing is working, I can't even seem to find the place to sort the categories into the order I want. I have been fiddling with this for a while, but I just can't quite get where I should be doing this category manipulation since I don't really get the order of operations here.
I am working locally using MAMP on my machine, so I don't have a working site to show yet, but I was hoping the demo linked above would be enough.
Filter Works by: All design effects illustrations?If so, that's not populated or sorted by JavaScript, it's there when I turn off JS in Firefox.
posted by artlung at 5:51 PM on January 10, 2012