Problem: I would like to generate an incremental value in a view.
Solution: You can use these custom shortcodes in a non-paginated, non-AJAX View:
global $tslooptotal; $tslooptotal = 0; function add_total_shortcode($atts, $content = '') { global $tslooptotal; $tslooptotal += $content; } add_shortcode('add-to-total', 'add_total_shortcode'); function show_total_shortcode() { global $tslooptotal; $totalNew = $tslooptotal; return $totalNew; } add_shortcode('show-total', 'show_total_shortcode');
Then in the Loop:
<wpv-loop> Loop number: [show-total]<br /> Total again: [show-total] [add-to-total]1[/add-to-total] </wpv-loop>
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.
Our next available supporter will start replying to tickets in about 0.43 hours from now. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 6 replies, has 2 voices.
Last updated by 6 years, 4 months ago.
Assisted by: Christian Cox.