Title: RunPHP &#8211; Breaking Outside The Loop
Last modified: August 18, 2016

---

# RunPHP – Breaking Outside The Loop

 *  [dyadcore](https://wordpress.org/support/users/dyadcore/)
 * (@dyadcore)
 * [19 years, 6 months ago](https://wordpress.org/support/topic/runphp-breaking-outside-the-loop/)
 * Bit of a difficult one. Basically, I want to have a php page which displays posts
   in a different way from normal. So I use RunPHP and the following:
 * <?php
    query_posts(‘cat=2’);
 * if (have_posts()) :
    while (have_posts()) : the_post(); the_title(); echo (‘‘);
   endwhile; endif;
 * break;
    ?>
 * Unfortunately, since RunPHP eval()s stuff inside the loop (as this is the way
   it works in the template) and I have just called query_posts it then spews out
   all the posts in Cat=2 in the usual manner. (I think).
 * Is there anyway to stop this either by breaking out of the loop or otherwise.
   I guess one could use WP_Query, but for some reason this works, but adds the 
   comment form to the bottom of the page and I’m not sure why.
 * Thanks a lot.
 * Alex

The topic ‘RunPHP – Breaking Outside The Loop’ is closed to new replies.

## Tags

 * [break](https://wordpress.org/support/topic-tag/break/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [dyadcore](https://wordpress.org/support/users/dyadcore/)
 * Last activity: [19 years, 6 months ago](https://wordpress.org/support/topic/runphp-breaking-outside-the-loop/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
