Support » Everything else WordPress » WordPress php code in an iframe doesnt work

  • json21

    (@json21)


    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)
  • Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Have you seen the WordPress theme repository http://wordpress.org/extend/themes/ ?

    Every theme is displayed through an iFrame.

    json21

    (@json21)

    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.