customize thumbnail grid category filter
-
Hey!
I'm working on a website and would like to add a specific feature:When clicking a category filter: a short description text of the category should appear between the filter list and the thumbnail grid.
This is how the website looks so far:
http://build.ribl.org/Would be happy to get some advice on how to approach this task with custom code...
thank you very much!
-
bind click events to the filters
https://laytheme.com/documentation/custom-javascript.html#binding-click-eventsread out the data-slug attributes:
https://api.jquery.com/attr/jQuery("…").attr("data-slug")
insert a div element into the dom at the right location containing some text. the text depends on the data-slug value
https://api.jquery.com/insertafter/you will probably also have to check if that div element exists already and then just replace its content:
https://api.jquery.com/html/and then style this with css
good luck, it will be a little hard to do if you haven't written javascript before
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it