• Resolved psheld

    (@psheld)


    I have two identical WordPress instances but for the current theme, running on the same server with the same editor and plugins. The newer one is my sandbox, and it runs off a duplicate of the older one’s database.

    I’m ready to switch off the older instance and point my domain to the new instance but for one thing, oembeds don’t work on the newer one.

    Here is example content from one post from the editor’s text view:

    ... to the end.]
    
    
    
    I've been hosted by ...

    The older instance shows the YouTube player without problem. View source shows:

    ... to the end.]</p>
    <p><iframe width="500" height="375" src="http://www.youtube.com/embed/UkhXr4u9_J4?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
    <p>I've been hosted by ...

    The sandbox simply prints the URL. View source:

    ... to the end.]</p>
    <p>http://youtu.be/UkhXr4u9_J4</p>
    <p>I’ve been hosted by ...

    When I run a live preview of the Twenty Thirteen theme in my sandbox, the YouTube player renders perfectly, just at a slightly larger size to the older site.

    I conclude that the problem must lie somewhere in the sandbox theme, Shoestrap. But I don’t know where to start looking. Any and all ideas most welcome. Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter psheld

    (@psheld)

    On the thread over at the Shoestrap theme forum, this question has been posed:

    Could this issue be occurring because of a prioritization issue within the theme, is wpautop being run after do_shortcode instead of before?

    Doesn’t mean much to me unfortunately, but I thought I’d add it here.

    Thread Starter psheld

    (@psheld)

    User esmi just pointed out on another thread here that this support forum isn’t for support of commercial products. Shoestrap is a free theme so hoping this thread stands? Particularly as I don’t seem to be the only person struggling with <p> tag wrapping oembed problems.

    I’m sorry but as you are using a non-WPORG theme, you need to seek support from the theme’s developers – paid or otherwise. We only support themes downloaded from wordpress.org here.

    Thread Starter psheld

    (@psheld)

    I guess from my explanation, it does look like a theme issue.

    Not sure then whether to mark this “resolved” or not? Perhaps you’ll do the honors esmi. Thanks.

    Some old topic but..

    I find wpautop usefull when i leave editor to beginners and people used to paste code from Word. This snippet for functions.php works in removing paragraphs around youtube link. Test it and see if there are no undesired effects.

    add_filter( 'the_content', 'my_autoembed_adjustments', 7 );
    /**
     * Add a new line around paragraph links
     * @param string $content
     * @return string $content
     */
    function my_autoembed_adjustments( $content ){
        $pattern = '|(?<!")(?<!"\s)(https?:\/\/[^\s"\[<]+)|im';    // your own pattern
        $to      = "<p>\n$1\n</p>";                          // your own pattern
        $content = preg_replace( $pattern, $to, $content );
        return $content;
    }

    Closing this 5 month old topic.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘oembed not working for a specific theme’ is closed to new replies.