• Resolved mmcculli

    (@mmcculli)


    I am trying to use the shortcode to control content on the page. The plugin adds a <p> to the page the messes up my page format.

    Example:

    [content_control logged_out message=””]
    <p class=”text-center”>Sign Up Information.</p>
    [/content_control]

    This outputs:
    <p class=”text-center”>Sign Up Information.</p>
    <p></p>

    How do I remove the <p> that is getting created?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Suki

    (@sukinoz)

    I have tried to replicate it.

    [content_control logged_out message=””]
    <p class=”text-center”>Sign Up Information.</p>
    [/content_control]

    but I get when log out:

    <p class="”text-center”">Sign Up Information.</p>

    and when log in:

    <div class=" jp-cc jp-cc-not-accessible">””</div>

    Plugin Author Daniel Iser

    (@danieliser)

    @mmcculli – Usually this means something is converting the line breaks between </p> & [/ to a new paragraph. All new line breaks used to be made new <p> tags, so possible its still that way in some sites/scenarios.

    Couple of things to try:
    – Put it all on one line. Don’t have a line break between the shortcode and inner tags.
    – Use divs. WP explicitly won’t convert divs to p tags and usually ignores the spaces as well as its no longer just paragraph text.

    Either way it is unlikley related to our plugin directly. We see similar new line issues with our other plugins that use shortcodes too from time to time. Less now with the block editor though.

    Hope that helps.

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