Title: Inline PHP for WordPress 2.8.6 (Conditional)
Last modified: August 19, 2016

---

# Inline PHP for WordPress 2.8.6 (Conditional)

 *  [asda](https://wordpress.org/support/users/then2s/)
 * (@then2s)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/inline-php-for-wordpress-286-conditional/)
 * WORDPRESS VERSION: 2.8.6 (I just did an upgrade from 2.7. everything was working
   GREAT with 2.7!!)
 * INLINE PHP TO RUN (pasted on the first line of EVERY article):
    < ?php if (is_single()){?
   > < ?php include (TEMPLATEPATH . ‘/ads-single-top.php’); ?> < ?php } ?> (which
   basically is a conditional php code that includes adsense ONLY when viewing the
   article in single.php)
 * The php works great when viewing the article in single.php.. but once it comes
   to index.php.. it doesnt work. On index.hph I am using “<?php the_excerpt() ?
   >”
 * I tried searching for plugins that RUN PHP INLINE code.. and they work.. but 
   only on single.php (like I said before)

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

 *  Thread Starter [asda](https://wordpress.org/support/users/then2s/)
 * (@then2s)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/inline-php-for-wordpress-286-conditional/#post-1283377)
 * UPDATE: I fixed the problem by the help of this post ( [http://wordpress.org/support/topic/281992?replies=3#post-1150732](http://wordpress.org/support/topic/281992?replies=3#post-1150732))
 * OPEN: plugin folder – exec-php/include/runtime.php
    FIND:
 *     ```
       function filter_user_content($content)
       	{
       		global $post;
       ```
   
 * ADD AFTER:
 *     ```
       if(strpos($content,'< ?php ')!==FALSE)
       	{
       		$content=str_replace('< ?php','<?php',$content);
       	}
       ```
   
 * HUGE THANKS TO mmorpglife!!!! [http://wordpress.org/support/topic/281992?replies=3#post-1150732](http://wordpress.org/support/topic/281992?replies=3#post-1150732)
 *  [McShelby](https://wordpress.org/support/users/mcshelby/)
 * (@mcshelby)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/inline-php-for-wordpress-286-conditional/#post-1283814)
 * This is an issue introduced with WordPress 2.8. See [http://core.trac.wordpress.org/ticket/10248](http://core.trac.wordpress.org/ticket/10248)

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

The topic ‘Inline PHP for WordPress 2.8.6 (Conditional)’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)
 * [index](https://wordpress.org/support/topic-tag/index/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [run](https://wordpress.org/support/topic-tag/run/)
 * [single](https://wordpress.org/support/topic-tag/single/)

 * 2 replies
 * 2 participants
 * Last reply from: [McShelby](https://wordpress.org/support/users/mcshelby/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/inline-php-for-wordpress-286-conditional/#post-1283814)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
