0

Hi i'm trying to add a php code generated by Shoretel Microsite in my Wordpress Custom page.

<?php
    $version = "all";   // "all" includes everything
            // "products" includes only product information

    $style = "2";   // "0" = Use your own Stylesheet
            // "1" = Stylesheet with nav on the left
            // "2" = Stylesheet with nav on the top

    $logo = "us";   // "us" ShoreTel Authorized Reseller
            // "eu" ShoreTel Authorised Partner
?>
<?php echo file_get_contents("http://micro.shoretel.com/www/?v=$version&s=$style&l=$logo&p=" . $_GET["p"]); ?> 

It worked before when i put it in my php file. But now when i add the code, the page won't load... how can i add this code then?

is there a proper way to do this?


<div id="contentRight">

 ***i want to put the code here...***

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
        <div id="content">
            <?php the_content(); ?>

** someone told me to use ,

wp_remote_get instead of file_get_contents

but how?

<?php wp_remote_get( "http://micro.shoretel.com/www/?v=$version&s=$style&l=$logo&p=" . $_GET["p"], $args ); ?> 
Jeremi Liwanag
  • 944
  • 4
  • 21
  • 44

1 Answers1

1

try an iframe instead. sounds like you are echoing out a full page inside a DIV and breaking the HTML.

for example :

<iframe src='<?php echo "http://micro.shoretel.com/www/?v=$version&s=$style&l=$logo&p=" . $_GET["p"] ?>' ></iframe>
blotto
  • 3,387
  • 1
  • 19
  • 19
  • is the code correct? i'm not very good with php.. but dreamweaver highlights the code as red.. – Jeremi Liwanag May 19 '13 at 06:07
  • try the above edit - using single quotes around the src attrib value – blotto May 20 '13 at 18:44
  • yeah! it worked, but how im going to customize it, css right? – Jeremi Liwanag May 20 '13 at 19:08
  • you would have to override their own CSS styles with a custom style sheet of your own. see http://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe. vote this answer up if it solved your original question - thanks! – blotto May 20 '13 at 20:54
  • thanks for this alternative solution, now im going to post another question in styling the iframe's content.. i dont have any control to css of the iframe's src.. i'm planning to override the styles. – Jeremi Liwanag May 20 '13 at 21:12