Support

Account

Home Forums Front-end Issues Fatal error: Call to undefined function have_rows() in

Helping

Fatal error: Call to undefined function have_rows() in

  • – Repeater field with 2 subfields
    – Fields are imported via ACF export/import functions.
    – Shows OK in specific Pages, can add data
    – No error if there is a data in specific Page, on front end
    – Error when there is no data

    I use custom templates for more advanced Pages, but decided to share same template code for few of Pages. Not so much data inside ACF fields, so I am not worried about pageload.

    Error is on line 7: if( have_rows( ‘ehrenmitglieder’ ) ) : ?>

    More is explained here:
    https://wordpress.org/support/topic/undefined-function-error-on-all-pages?replies=2

    Whole code is like this:

    <?php
    /* 
     * Paginate Advanced Custom Field repeater
     */
    
    // ACF Loop
    if( have_rows( 'ehrenmitglieder' ) ) : ?>
    <div class="separated-item- col-md-24">
    <div class="bd-griditem-">
    <div class=" bd-layoutcontainer-">
    <div class="bd-container-inner">
    <div class="container-fluid">
      <?php while( have_rows( 'ehrenmitglieder' ) ): the_row();
    ?>                     
        
        <div class="row bd-row-flex bd-row-align-top bd-collapsed-gutter ehrenmitglieder-alternate">
    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 ehrenmitglieder-title">
      <div class="bd-layoutcolumn-">
      <div class="bd-vertical-align-wrapper text-center">
    	<?php if ( '✟' == get_sub_field('verstorbene') ): ?>
        <h5><?php echo '✟'; ?></h5>
    <?php else: ?>
    <?php endif; ?>
    </div>
      </div>
      </div>
    <div class="col-xs-22 col-sm-22 col-md-22 col-lg-22 ehrenmitglieder-text">
      <div class="bd-layoutcolumn-">
      <div class="bd-vertical-align-wrapper">
        <?php echo get_sub_field('Name'); ?>
        </div>
    </div>
        </div>
      </div>
    
      <?php endwhile;
      ?>
    
    <?php else: ?>
    
    <?php endif; ?>
    </div>
    </div>
    </div>
    </div>
    </div>
    
  • Stupid me, Plugin Organizer plugin was set to not allow ACF on those pages.
    Sorry for bothering.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.