WordPress php code in an iframe doesnt work (3 posts)

  1. json21
    Posted 3 years ago #

    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.

  2. Andrew Nevins
    Forum moderator
    Posted 3 years ago #

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

    Every theme is displayed through an iFrame.

  3. json21
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.