Php template question

7 replies
I have this php template with which i am able to display an amazon astore on my wordpress site. I am wondering if there is a way for me to include a section in which I can also have text or html display on top or underneath.

<?php
/*
Template Name:A Store
*/
?>
<?php get_header(); ?>
<iframe src="http://astore.amazon.com/" width="100%" height="4000" frameborder="0" scrolling="no"></iframe>
<?php get_footer(); ?>
#php #question #template
  • Profile picture of the author MeanWalrus
    I can't post text or images yet, so I'm giving you a pastebin link.

    Here is an improved version of your script:

    pastebin(dot)com/0EwNZyfc

    As for putting in HTML wherever you want, you can already do that in PHP. You just can't put raw HTML code inside of <?php ?> brackets unless if in quotations for assignment to a variable or echoing a command. I don't really know how to explain it.

    Here is an example


    <!DOCTYPE html>
    <html>
    <head>
    <title>My webpage</title>
    </head>
    <body>
    The current year is <?php echo date('Y')?>. Your IP address is <?php echo $_SERVER['REMOTE_ADDR'];?>.
    </body>
    </html>


    Note to moderators: I tried to use the PHP tags but the page simply went blank when I tried to preview it if I had actual PHP code within the tags. This is the best I could do.
    {{ DiscussionBoard.errors[7112707].message }}
    • Profile picture of the author Conrad C King
      I can't post text or images yet, so I'm giving you a pastebin link.

      Here is an improved version of your script:

      pastebin(dot)com/0EwNZyfc

      As for putting in HTML wherever you want, you can already do that in PHP. You just can't put raw HTML code inside of <?php ?> brackets unless if in quotations for assignment to a variable or echoing a command. I don't really know how to explain it.

      Here is an example


      <!DOCTYPE html>
      <html>
      <head>
      <title>My webpage</title>
      </head>
      <body>
      The current year is <?php echo date('Y')?>. Your IP address is <?php echo $_SERVER['REMOTE_ADDR'];?>.
      </body>
      </html>


      Note to moderators: I tried to use the PHP tags but the page simply went blank when I tried to preview it if I had actual PHP code within the tags. This is the best I could do.[/QUOTE]

      Can't use Quote function either.

      Thanks again very good looking example, very helpful.

      <?php /* Dynamic usage example: http://yourwebsite.com/filename.php?name=appl - Pastebin.com
      Signature

      Whatever the mind can conceive and the heart can believe the body can achieve
      http://www.Kiva.org

      {{ DiscussionBoard.errors[7112849].message }}
      • Profile picture of the author MeanWalrus
        Originally Posted by Conrad C King View Post

        Thanks again very good looking example, very helpful.
        Sorry, I just realized a typo in that link of mine on the pastebin link.

        I forgot to end line 12, simply put a ; on the end of it.

        Also the quote appears to be working for me, just rather glitchy.
        {{ DiscussionBoard.errors[7117299].message }}
  • Profile picture of the author Conrad C King
    Thank you FirstSocialApps and MeanWalrus for your help. This gives the help I needed. :-)
    Signature

    Whatever the mind can conceive and the heart can believe the body can achieve
    http://www.Kiva.org

    {{ DiscussionBoard.errors[7112734].message }}
    • Profile picture of the author MeanWalrus
      Originally Posted by Conrad C King View Post

      Thank you FirstSocialApps and MeanWalrus for your help. This gives the help I needed. :-)
      No problem, feel free to contact me if you need any more help.
      {{ DiscussionBoard.errors[7112757].message }}
  • Profile picture of the author soniamit
    upload code in header.php
    {{ DiscussionBoard.errors[7115604].message }}

Trending Topics