Viewing 2 replies - 1 through 2 (of 2 total)
  • You can put php in a post by using a plugin like this one:

    http://ww.wp.xz.cn/extend/plugins/php-execution-plugin/

    Thread Starter cje

    (@cje)

    thanks a lot!
    btw, do you know php code?
    I’ve tried to use 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 error

    Fatal 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!

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

The topic ‘Php script in post…?’ is closed to new replies.