Problem:
Use different templates to different users depending on a cookie.
Solution:
You'll need your own solution for handling the cookies, but you can then switch templates using a little code.
The wpv_filter_force_template filter (https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_force_template) can be used to switch Views Content Template.
If you are using Layouts there is a filter get_layout_id_for_render that you can use, but it's not documented. You would use it something like this:
function tssupp_switch_layout( $layout_id, $slug ){ // test for cookie value and modify current $layout_id as required return $layout_id; } add_filter( 'get_layout_id_for_render', 'tssupp_switch_layout', 10, 2 );
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 1 reply, has 2 voices.
Last updated by 6 years, 11 months ago.
Assisted by: Nigel.