Support » Fixing WordPress » Iframe woes

  • Resolved contagiousmyle


    Hey All,

    I’m trying to embed my blog ( on my site ( I tried doing it with just iframe html, but the size specifications just got messed up.

    I installed the “embed iframe” plugin ( and it’s working better, however i need to change it so that there is no horizontal scroll.

    How do i change the php so that the horizontal content is cropped and there is only a vertical scroll?

    Plugin Name: Embed Iframe
    Plugin URI:
    Description: Allows the insertion of code to display an external webpage within an iframe. The tag to insert the code is: [iframe url width height]
    Version: 1.0
    Author: Deskera
    Author URI:

    1.0 – Initial release

    include (dirname (__FILE__).’/plugin.php’);

    class EmbedIframe extends EmbedIframe_Plugin
    function EmbedIframe ()
    $this->register_plugin (’embediframe’, __FILE__);

    $this->add_filter (‘the_content’);
    $this->add_action (‘wp_head’);

    function wp_head ()


    function replace ($matches)
    $tmp = strpos ($matches[1], ‘ ‘);
    if ($tmp)
    // Because the regex is such a nuisance
    $url = substr ($matches[1], 0, $tmp);
    $rest = substr ($matches[1], strlen ($url));

    $width = 400;
    $height = 500;

    $parts = array_values (array_filter (explode (‘ ‘, $rest)));
    $width = $parts[0];

    unset ($parts[0]);
    $height = implode (‘ ‘, $parts);

    return $this->capture (‘iframe’, array (‘url’ => $url, ‘width’ => $width, ‘height’ => $height));

    return ”;

    function the_content ($text)
    return preg_replace_callback (“@(?:<p>\s*)?\[iframe\s*(.*?)\](?:\s*</p>)?@”, array (&$this, ‘replace’), $text);

    $embediframe = new EmbedIframe;

    This is the problem:

    i want to get rid of that pesky horizontal scroll.

  • The topic ‘Iframe woes’ is closed to new replies.