WordPress.org

Forums

[resolved] WordPress Editor Doesn't Format Custom Shortcode! (2 posts)

  1. fatalx
    Member
    Posted 4 years ago #

    Hello Everyone,

    I wrote a simple little plugin that embeds videos into JW Player. It does this by using a shortcode [flv]

    so for example

    [flv]video url[/flv]

    when I put this into the editor and try to center it, it generates this code in the editor.

    <p style="text-align: center;">[flv]video[/flv]</p>

    however on the actual site the [flv] embed code is outside of the <p>

    looks like this

    <p style="text-align: center;"></p>
    <object blah blah blah

    Does anyone know why this is?

  2. fatalx
    Member
    Posted 4 years ago #

    Fixed my problem.

    My embed code was enclosed in a div and you can't put divs into <p> tags. Since a <div> is a block element and <p> only allows inline elements. The proper solution is to replace the <div> with a <span>.

    Hope this helps someone in the future.

Topic Closed

This topic has been closed to new replies.

About this Topic