Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    172
    Thanks
    64
    Thanked 2 Times in 2 Posts

    iframe and php code

    I have a wordpress blog, with an iframe included in sidebar.php. I have some wordpress specific code inside of this iframe, and it does not seem to "interact" with the rest of the wordpress code. Is it normal? Is there any way to get around this one?

    Code:
    <ul><li><a href="http://www.domain.com/" target="_blank">domain.com</a></li><?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.name.com/pictures/<?=str_replace(' ', '+', $actor_name)?>" target="_blank"><?=$actor_name?> Model Search</a></li></ul>
    Thank you.

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,216
    Thanks
    12
    Thanked 338 Times in 334 Posts
    Quote Originally Posted by joliett89 View Post
    I have some wordpress specific code inside of this iframe, and it does not seem to "interact" with the rest of the wordpress code. Is it normal?
    yes. content in a frame is a separate web page. it’s as if you had two windows.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • Users who have thanked Dormilich for this post:

    joliett89 (02-17-2013)

  • #3
    Regular Coder
    Join Date
    Jul 2011
    Posts
    172
    Thanks
    64
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Dormilich View Post
    yes. content in a frame is a separate web page. it’s as if you had two windows.
    And there's no way to get around it, right?

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,216
    Thanks
    12
    Thanked 338 Times in 334 Posts
    depends on what you understand by "interaction".
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • Users who have thanked Dormilich for this post:

    joliett89 (02-17-2013)

  • #5
    Regular Coder
    Join Date
    Jul 2011
    Posts
    172
    Thanks
    64
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Dormilich View Post
    depends on what you understand by "interaction".
    I am basically trying to get it to work with the rest of the Wordpress. It is a Wordpress blog, one of the files of the program is called sidebar.php (just like regular website, it gets loaded with header, content, footer etc), and I have the iframe included in that. I would like the php code to work with the rest of the program. The code is in the first post.

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,592
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Quote Originally Posted by joliett89 View Post
    I am basically trying to get it to work with the rest of the Wordpress. It is a Wordpress blog, one of the files of the program is called sidebar.php (just like regular website, it gets loaded with header, content, footer etc), and I have the iframe included in that. I would like the php code to work with the rest of the program. The code is in the first post.
    The content of the iframe is NOT a Wordpress blog - it is a completely separate page. If you want it to be part of the Wordpress blog then get rid of the iframe.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    joliett89 (02-17-2013)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •