Title: run PHPscript on a page
Last modified: August 18, 2016

---

# run PHPscript on a page

 *  Resolved [Pieter Bos](https://wordpress.org/support/users/senlin/)
 * (@senlin)
 * [19 years ago](https://wordpress.org/support/topic/run-phpscript-on-a-page/)
 * Hi,
    I am having the same difficulties as Haecceity had ([http://wordpress.org/support/topic/91991?replies=5](http://wordpress.org/support/topic/91991?replies=5)).
   Although I am using ExecPHP instead of runPHP.
 * I understand what needs to be done to being able to run PHP on a page (put the
   entire php coding into one php”block”), but I don’t have a clue on how to do 
   that 🙁
 * Basically I would like to put the following code into one so that runPHP sees
   it as 1 block:
 *     ```
       <?php query_posts('category_name=whatson&showposts=7'); ?>
       <?php while (have_posts()) : the_post(); ?>
   
       <div class="post" id="post-<?php the_ID(); ?>">
   
       <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?> &raquo;</a></h2>
   
       <p class="postinfo">By <?php the_author_posts_link(); ?> on <?php the_time('M j, Y') ?> in <?php the_category(', ') ?> | <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?><?php edit_post_link('Edit', ' | ', ''); ?>
   
       <div class="entry">
       <?php the_content(); ?>
       </div>
       </div>   
   
       <?php endwhile; endif; ?>
       ```
   
 * (not sure if the last `<?php endwhile; endif; ?>` has to be included or not…)
 * I hope someone can help me with this or point me into the right direction, that
   would be awesome!
 * Thanks,
    Piet

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

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years ago](https://wordpress.org/support/topic/run-phpscript-on-a-page/#post-592919)
 * That seems like a template code… why would you want THAT in a post/Page?
 *  Thread Starter [Pieter Bos](https://wordpress.org/support/users/senlin/)
 * (@senlin)
 * [19 years ago](https://wordpress.org/support/topic/run-phpscript-on-a-page/#post-592940)
 * because i am using the EventCalendar plugin and I would like to post not only
   the list of events on that page, but the entire content.
 * I don’t use any other categories and I do not use the blog for other entries 
   than events that go into the calendar.

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

The topic ‘run PHPscript on a page’ is closed to new replies.

## Tags

 * [PHP in page](https://wordpress.org/support/topic-tag/php-in-page/)

 * 2 replies
 * 2 participants
 * Last reply from: [Pieter Bos](https://wordpress.org/support/users/senlin/)
 * Last activity: [19 years ago](https://wordpress.org/support/topic/run-phpscript-on-a-page/#post-592940)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
