0

I've wrote a few line in order to show a restaurant menu in a page using a shortcode

add_shortcode ('pescato_repeater', 'pescato_repeater_fn');
  function pescato_repeater_fn() {
    if( have_rows('pescato') ) {
    $content = '<h2>Pescato del Mediterraneo<br><span id="eng">Caught of the Mediterranean</span></h2><table>';
      while( have_rows('pescato') ) { 
        the_row();
        $nome = get_sub_field('name');
        $content .= '<tr><td>' . implode("<br><span id=\"eng\">", $name) . '</span></td><td class="price">' .  get_sub_field('price') . ' €/Kg</td><tr>';
      }
    $content .= '</table>';
    }
    return $content;
}

the sub field name is a group in which there are names in italian and english, so I'm using implode in order to show the array.

elementor preview

The elementor preview is showing it correctly, but the page doesn't. It has worked for a while but now, if I try to refresh the page, the loading seems to be locked in a loop that never ends

Any suggestions? Thanks in advance :)

2
  • "It has worked for a while but now, if I try to refresh the page, the loading seems to be locked in a loop that never ends". Sounds like an error introduced by something else. Did you modify/add any extra feature to the site. Your shortcode callback looks good, I don't see a reason for an infinite loop there. Do you have WP_DEBUG set to true? Aug 5 at 16:50
  • 'What does "the page doesn't [show it correctly]" mean? Just the "loading loop bit?
    – bosco
    Aug 6 at 1:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.