My template is very simple:
get_header();
$new_p = get_posts(array('post_type' => 'post', 'numberposts' => 6));
get_footer();
whenever I put var_dump($new_p);
or print_r($new_p);
below $new_p = get_posts(array('post_type' => 'post', 'numberposts' => 6));
, it gives me the white screen.
Why on Earth would it do it??
This code is OK, though:
var_dump(wp_get_recent_posts(array('post_type' => 'tdlrm_store_item', 'numberposts' => 8), OBJECT));
Any ideas?
My template is very simple:
get_header();
$new_p = get_posts(array('post_type' => 'post', 'numberposts' => 6));
get_footer();
whenever I put var_dump($new_p);
or print_r($new_p);
below $new_p = get_posts(array('post_type' => 'post', 'numberposts' => 6));
, it gives me the white screen.
Why on Earth would it do it??
This code is OK, though:
var_dump(wp_get_recent_posts(array('post_type' => 'tdlrm_store_item', 'numberposts' => 8), OBJECT));
Any ideas?
Share Improve this question edited Feb 8, 2021 at 10:02 Tom J Nowell♦ 61k7 gold badges79 silver badges148 bronze badges asked Feb 8, 2021 at 9:25 ArtemArtem 3152 silver badges13 bronze badges 2- 2 Have you checked your PHP error log for the error message? – Tom J Nowell ♦ Commented Feb 8, 2021 at 10:02
- 1 Oh my, I didn't. I have the display_errors on, and was just expecting to see the errors on page, completely forgot to check the error log. How dumb is that ( I've found what caused the problem, though. Someone had put a base64-encoded image into the post content, and the system ran out of memory trying to output it. – Artem Commented Feb 8, 2021 at 11:02
1 Answer
Reset to default 2Actually, memory was exhausted. Someone has copy-pasted an actual 2MB base64-encoded image into the post content, var_dump was trying to output it. Had to delete the image via PHPMyAdmin, because the WP editor won't open. Once it had been deleted, the problem was gone.