Advertisement
verygoodplugins

Untitled

Jul 26th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. function repeater_function() {
  2.  
  3.     $output = '<ul>';
  4.  
  5.     $rows = get_field( 'repeater_field' );
  6.  
  7.     foreach ($rows as $row )
  8.        
  9.         $output .= '<li>' . $row['title'] . '</li>';
  10.  
  11.     }
  12.  
  13.     $output .= '</ul>';
  14.  
  15.     return $output;
  16.  
  17. }
  18.  
  19. add_shortcode( 'my_repeater', 'repeater_function' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement