• rickvandeven

    (@rickvandeven)


    Via ajaxSubmit i’m submitting a form.
    First i kept getting the message that WP_Query did not exist. After a lot of searching i found that i had to include the wp-blog-header file. Since i did that, i don’t get errors anymore.

    However when i do:

    $loop = new WP_Query(  array( 'post_type' => 'calculator')  );
    while ( $loop->have_posts() ) : $loop->the_post();
     the_title();
    endwhile;
    ?>

    (or other things i’ve tried) It appears that there are no posts since nothing happens in my loop.

    Would be awesome if somebody could help me out..
    Thanks in advance.

    Rick

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

The topic ‘WP_Query in external file (Ajax Call)’ is closed to new replies.