Title: WordPress php code in an iframe doesnt work
Last modified: August 20, 2016

---

# WordPress php code in an iframe doesnt work

 *  [json21](https://wordpress.org/support/users/json21/)
 * (@json21)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wordpress-php-code-in-an-iframe-doesnt-work/)
 * I have an iframe on sidebar.php, and WordPress php code inside of it does not
   seem to work. The code looks something like this:
 *     ```
       <?php $blog_title =  esc_attr( get_bloginfo( 'name', 'display' ) );
       $words = split(' ', $blog_title);
       $actor_name = ucwords($words[0] . ' ' . $words[1]); ?>
       <li><a href="http://www.domain.com/pics/<?=str_replace(' ', '+', $actor_name)?>" target="_blank"><?=$actor_name?> pic search</a></li>
       ```
   
 * Is WordPress php code inside an iframe suppose to work with other code outside
   of this iframe? It looks like it doesnt… Is there any way to get it to work?
 * Thank you.

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wordpress-php-code-in-an-iframe-doesnt-work/#post-3465182)
 * Have you seen the WordPress theme repository [http://wordpress.org/extend/themes/](http://wordpress.org/extend/themes/)?
 * Every theme is displayed through an iFrame.
 *  Thread Starter [json21](https://wordpress.org/support/users/json21/)
 * (@json21)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wordpress-php-code-in-an-iframe-doesnt-work/#post-3465191)
 * So this would mean that the above code should work from within an iframe located
   in sidebar.php (just the way css and html does)?
 * If so, how can I figure out why is it not working?
 * Thank you.

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

The topic ‘WordPress php code in an iframe doesnt work’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 2 replies
 * 2 participants
 * Last reply from: [json21](https://wordpress.org/support/users/json21/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/wordpress-php-code-in-an-iframe-doesnt-work/#post-3465191)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
