Error using Php code in post
-
I’ve activated the php-execution-plugin
I my post I’ve used the bellow code to display a random post,
from my category “category | test”,
in a static page,
on the front page
but it returns a fatal errorFatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 35 bytes) in /var/www/testserver/test/wp-includes/plugin.php on line 385
<?php
$rand_posts = get_posts(‘numberposts=1&offset=1&
category_name=category | test&orderby=rand’);
foreach( $rand_posts as $post ) :
?>
<div class=”body”> <?php the_excerpt(); ?></div>
<?php endforeach; ?>Do you know what’s wrong?
Thanks for any suggestions!
- The topic ‘Error using Php code in post’ is closed to new replies.