conditional slider selection
-
Topic
-
on the home page, i’d like to swap the default slider for an “inclement weather” slider whenever the “inclement weather” ninja announcement is active. i’ve got the logic and hook to test if the ninja announcement is active. i just need to figure out how to make the different slider show if my condition evals to true.
i can think of several ways to accomplish this, but wanted your input. here are a few ways i came up with:
1. brute SQL.if (true) UPDATE something SET {slider element within Home Layout} = 'incliement-weather-slider' WHERE {whatever} = 'home-slider'
2. content hookif (true) preg_replace('{some fancy expression to grab the slider HTML}', do_action('[slider id="inclement-weather-slider"]', $content))
3. SUPER COMPLICATED modification to the element/layout system wherein there is “element logic” kind of like the widget logic plugin
4. some hybrid of the above. e.g. have BOTH sliders in the home page layout but have some hook that cancels one out based on some condition. actually, that sounds the most straightforward.what would you suggest?
- The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.