• Resolved paullferguson

    (@paullferguson)


    Hi, Enjoying the simplicity of the plugin but after using it on a few sites now I’ve run into the same problem each time. Placing the shortcode in page content brakes the output out of the <p> as the shortcode output is wrapped in a <div>.
    Maybe a shortcode attribute of “inline” would work, using <span> instead.

    Paul

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Florian Ziegler

    (@florianziegler)

    Hi Paul!

    There is a filter you can use to change the output to any format you like.

    A very quick way to change the div to a span would be the following:

    function my_theme_change_swarm_output( $output ) {
        return str_replace( array( '<div', '</div>'), array( '<span', '</span>' ), $output );
    }
    
    add_filter( 'whereabouts-swarm-output', 'my_theme_change_swarm_output', 10 );
    

    Just copy the code into your theme’s functions.php and that’s it. ??

    Cheers
    Florian

    Thread Starter paullferguson

    (@paullferguson)

    Thanks for the quick response. Worked perfectly, thanks so much ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcode Inline element’ is closed to new replies.