Support » Fixing WordPress » Getting IDs without printing them?

  • There’s something wrong in this code:

    $myQuery = new WP_Query();
    $myArray = array();
    while ($myQuery->have_posts())
    global $post;
    $myArray[] = $post->ID;
    echo count($myArray);

    On the last line in the while block, I get this error:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes)

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Getting IDs without printing them?’ is closed to new replies.