GEges
Forum Replies Created
-
Understood.
Hi @priethor, hi @cbravobernal ! I’m sorry if I reply this late, been busy with something else.
I just stopped using the Divi 5 loop builder and went back to writing custom code myself. That’s the only way for me to control everything.
An error has occurred while saving your page. Various problems can cause a save to fail, such as a lack of server resources, firewall blockages, plugin conflicts or server misconfiguration. You can try saving again by clicking Try Again, or you can download a backup of your unsaved page by clicking Download Backup. Backups can be restored using the portability system while next editing your page.
Contacting your host and asking them to increase the following PHP variables may help: memory_limit, max_execution_time, upload_max_filesize, post_max_size, max_input_time, max_input_vars. In addition, auditing your firewall error log (such as ModSecurity) may reveal false positives that are preventing saves from completing.
Lastly, it is recommended that you temporarily disable all WordPress plugins and browser extensions and try to save again to determine if something is causing a conflict.
Forum: Plugins
In reply to: [Secure Custom Fields] SCF repeater usage in function to create shortcodeThis is how I made it work:
function past_montante_shortcode() {
ob_start(); // Start output buffering// Query all the prono posts $args = array( 'post_type' => 'pronostic', 'posts_per_page' => 1, // Fixed typo (was post_per_page) 'post_status' => 'publish' // Fixed (was published) ); $prono_query = new WP_Query($args); if($prono_query->have_posts()) : while($prono_query->have_posts()) : $prono_query->the_post(); $montantes_precedentes = get_field('montantes_precedentes', get_the_ID()); if(!empty($montantes_precedentes)) : ?> <section id="past-montantes-splide-section" class="splide" aria-label="Past Montantes Slider"> <div class="splide__track"> <ul class="splide__list"> <?php foreach($montantes_precedentes as $montante) : if(!empty($montante['image_montante'])) : ?> <li class="splide__slide"> <img src="<?php echo esc_url($montante['image_montante']); ?>" alt="Montante précédente" class="splide-slide-image" loading="lazy"> </li> <?php endif; endforeach; ?> </ul> </div> </section> <script> document.addEventListener('DOMContentLoaded', function() { if(typeof Splide !== 'undefined') { const pastMontanteDesktopSlider = new Splide('.splide', { type: 'loop', perPage: 1, perMove: 1, gap: '1rem', pagination: true, arrows: true, lazyLoad: 'nearby', breakpoints: { 768: { perPage: 1 } } }).mount(); } }); </script> <?php else : ?> <p class="no-montantes">No montantes précédentes found.</p> <?php endif; endwhile; endif; wp_reset_postdata(); return ob_get_clean();}
add_shortcode(‘past_montantes’, ‘past_montante_shortcode’);it works just fine
Thank you all for your responses and your help.