i'm trying to use the exec-php plugin to show the most recent post at the bottom of the homepage here. but for some reason it screwing up the works. i created a test page here to show you what the page looks like without the plugin. here's the code i'm using at the bottom of the homepage to make the plugin run: <h2>Latest Free Poker Mechanic Tip</h2> <?php $latestposts = get_posts('numberposts=1&category=1'); foreach($latestposts as $post) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>"><?php echo $post->post_title; ?></a></h2> <?php the_content(); ?> <?php endforeach; ?> PHP: how do i fix it so that it looks right and shows the most recent post at the bottom of the homepage???
thanks dawn. i'm trying that out here, but for some reason (even though i have this code in the HTML editor, not the VISUAL editor), when you view the page, you actually see the code and not what its supposed to be doing. please advise. <h2>Latest Free Poker Mechanic Tip</h2> <phpcode> <?php $latestposts = get_posts('numberposts=1&category=1'); foreach($latestposts as $post) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>"><?php echo $post->post_title; ?></a></h2> <?php the_content(); ?> <?php endforeach; ?> </phpcode> Code (markup):
nevermind, i got it working with this plugin: http://wordpress.org/extend/plugins/php-execution-plugin/