• Resolved Ziky

    (@ewsel)


    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

    (@bcworkz)

    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

    (@ewsel)

    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.