Problem: I have a Form that is uesd to edit posts. I would like to include a next and previous post link so that I can edit the next or previous post easily without returning to a list of posts.
Solution: Create a paginated, filtered View that displays only 1 post, using AJAX pagination updates. In the Loop Output editor for this View, place an Edit Post Form. Place this View on a custom Page.
In another custom Page, place a filtered View that shows all the posts. Next to each post, create a custom edit post link that directs the User to the other custom Page, using a pagination URL parameter based on the loop iteration.
add_shortcode( 'loop-iteration', function( $atts ){ global $loop_n; if ( !isset( $loop_n ) ) { $loop_n = 1; return $loop_n; } $loop_n++; if ( !isset( $atts['n'] ) ) { // no nth parameter, just return the current index return $loop_n; } else { $remainder = ( $loop_n + 1 ) % $atts['n']; return ( $remainder == 0 ); } });
<a href="/view-2-page?wpv_paged=[loop-iteration]">[wpv-post-title]</a>
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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
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)
Este tema contiene 17 respuestas, tiene 3 mensajes.
Última actualización por hace 6 años, 4 meses.
Asistido por: Christian Cox.