Title: Inline PHP example
Last modified: August 19, 2016

---

# Inline PHP example

 *  [Jimmy](https://wordpress.org/support/users/j_stewart89/)
 * (@j_stewart89)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/inline-php-example/)
 * I’m using the Inline PHP plugin and the documentation is almost nonexistent so
   was hoping someone might have an example. I can do the following code without
   a problem but as soon as I try to use HTML coding to modify the output, nothing
   works. It is as if the query_posts gets flushed from memory when I end the <exec
   > using the </exec>.
 * The code below will display my posts, however, I want to format the posts by 
   adding Author, Date, Comments, etc… nothing I’ve tried will render properly and
   I believe it is due to the syntax of this plugin but again, no documentation 
   and the links don’t work on the plugin. Thanks in advanced to anyone who can 
   help.
 *     ```
       <exec>
       query_posts('cat=10'.'&orderby=date&order=asc');while (have_posts()) : the_post();
       endwhile;
       </exec>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/inline-php-example/#post-1343109)
 * i have no experience with this plugin, but from logic, it looks this is just 
   for php code. to get html stuff, you could try and echo it from the php code:
   
   for example:
 *     ```
       <exec>
       query_posts('cat=10'.'&orderby=date&order=asc');while (have_posts()) : the_post();
       echo '<div class="post"><h3>';the_title(); echo '</h3>'; the_content(); echo '</div>';
       endwhile;
       </exec>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Inline PHP example’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/inline-php-example/#post-1343109)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
