Title: Getting Member Function Error
Last modified: August 21, 2016

---

# Getting Member Function Error

 *  Resolved [Ziky](https://wordpress.org/support/users/ewsel/)
 * (@ewsel)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/getting-member-function-error/)
 * Hallo,
 * i made a custom post loop query to load a meta data.
    I get this error: `Fatal
   error: Call to a member function have_posts() on a non-object in /home/usr/public_html/
   wp-content/themes/skin/tabs/lib/link_tab.php on line 98`
 * Code from link_tab.php line 98-104
 *     ```
       while ( $linktab->have_posts() ) : $linktab->the_post();
       $custom_fields = get_post_custom();
       global $post;
       $link_tab = get_post_meta($post->ID,'link_tab', true );
       foreach ( $link_tab as $key => $value ) {
       require_once ('linksload.php'); //php code file
       $link = new Link( $value );
       ?>
       ```
   
 * i can not see any error its work perfekt if i use the $value as url

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/getting-member-function-error/#post-4749648)
 * The problem is `$linktab` is not a proper WP_Query object. You don’t indicate
   how `$linktab` is assigned. It should be something like `$linktab = new WP_Query(
   $args );` where `$args` are the query arguments defining what sort of query to
   run.
 *  Thread Starter [Ziky](https://wordpress.org/support/users/ewsel/)
 * (@ewsel)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/getting-member-function-error/#post-4749655)
 * hallo,
 * i have also great the new query and all of this the problem was in query code
   now its work thex for the help..
 * –CLOSED–

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

The topic ‘Getting Member Function Error’ is closed to new replies.

## Tags

 * [fatal](https://wordpress.org/support/topic-tag/fatal/)
 * [have_posts()](https://wordpress.org/support/topic-tag/have_posts/)
 * [member](https://wordpress.org/support/topic-tag/member/)
 * [non object](https://wordpress.org/support/topic-tag/non-object/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [Ziky](https://wordpress.org/support/users/ewsel/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/getting-member-function-error/#post-4749655)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
