.. But I can't use this code, I need it all to be pure php code (like, without the opening and closing tags ). I'm not familiar with how to do this.
The reason I'm asking is that I'm trying to use it as a plugin for phpfox (a social networking script), which only accepts php code without opening/closing tags. Could someone help me convert the code or something? Thanks.
Question
+jamesyfx Subscriber²
Hi,
I need to put some wordpress code into a php file, for instance display the latest 3 posts.. I've seen this snippet of code:
<?php // Include Wordpress define('WP_USE_THEMES', false); require('./blog/wp-load.php'); query_posts('showposts=1'); ?> <?php while (have_posts()): the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_excerpt(); ?> <p><a href="<?php the_permalink(); ?>">Read more...</a></p> <?php endwhile; ?>.. But I can't use this code, I need it all to be pure php code (like, without the opening and closing tags ). I'm not familiar with how to do this.
The reason I'm asking is that I'm trying to use it as a plugin for phpfox (a social networking script), which only accepts php code without opening/closing tags. Could someone help me convert the code or something? Thanks.
Link to comment
Share on other sites
21 answers to this question
Recommended Posts