Title: Refreshing a loop
Last modified: August 20, 2016

---

# Refreshing a loop

 *  [kevr1990](https://wordpress.org/support/users/kevr1990/)
 * (@kevr1990)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/refreshing-a-loop/)
 * I’m trying to make a section of my page refresh every few minutes to display 
   updated content but am struggling.
 * I run a football blog and on matchdays we have live match discussion. On the 
   sidebar we have match information brought in through a custom field. I want that
   data to automatically refresh without our users having to refresh the whole page.
 * The java I am using refreshes non-loop content fine but when I try to put in 
   a call for custom fields it has an issue. First load is fine, but it displays
   an error after the refresh. Error and code below. Any ideas?
 * [http://nonaynever.net/4290/live-blog-burnley-vs-cardiff-city/](http://nonaynever.net/4290/live-blog-burnley-vs-cardiff-city/)
 * **ERROR**
    FATAL ERROR: CALL TO UNDEFINED FUNCTION GET_POST_META() IN /HOME/KEVRCOUK/
   PUBLIC_HTML/NNN/WP-CONTENT/THEMES/THEMORNINGAFTER/LIVETEAMS.PHP ON LINE 2
 * **Header.php**
    <script> setInterval(function(){ $(“#scores”).load(“<?php bloginfo(‘
   template_directory’);?>/liveteams.php #scores”); }, 30000); </script>
 * **liveteams.php**
    <div id=”scores”> <div class=”column span-3 first”><p class
   =”team”><?php echo get_post_meta($post->ID, ‘homelineup’, true); ?></p></div>
   <div class=”column span-3 first”><p class=”team”><?php echo get_post_meta($post-
   >ID, ‘awaylineup’, true); ?></p></div> . </div>

The topic ‘Refreshing a loop’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [kevr1990](https://wordpress.org/support/users/kevr1990/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/refreshing-a-loop/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
