简体   繁体   中英

How to hide and unhide div section in wordpress using page builder?

Currently , I have this page which display all the testimonies from year 2012 until 2016. But I would like to create a hyperlink which user can view testimony by year. Example, Graduate of 2016 | 2014 | 2013 | 2012

When user click 2016, all other year's testimonies are hidden and vice versa. Link is http://caa.org.my/demo/testimonial-2/

I tried to add javascript which block the whole year but seem like not working at page builder.

By the way, I don't use jquery but only pure javascript.

Anyone can help?

Regards, Steve

Why don't you create taxonomy "year" for testimonial post type? Assign to every post type specific year. Then you can access it by slug of this taxonomy and value of term ( ie year/2016, or testimonials_year/2016 ) . Then just adjust template for it. See: https://developer.wordpress.org/themes/basics/template-hierarchy/ for template hierarchy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM