Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39751
    Craig Albert
    Guest

    I’m creating an accordion inside Boldgrid column, using the Boldgrid Post and Page Builder. Per suggestions elsewhere in this support, I’m doing it using the Collapse-O-Matic plugin, which works by using a shortcode entitled [expand][/expand], and I’m editing the code inside of the text view. WHen I click “Update”, Boldgrid inserts, after every entry, an additional paragraph — <p> </p> —- and also surround each accordion item with paragraph breaks. If I delete them in the text editor, they re-appear. If I delete them in the visual editor, they reappear. This is really messing up the appearance of this accordion. Can you help?

    #39763
    Jesse Owens
    Keymaster

    Hi Craig-

    Thanks for the great question, and thanks for using the Post and Page Builder for WordPress.

    This behavior is known as “wpautop,” a function WordPress has built-in to make sure that all of your HTML is “valid.” There are plugins out there like Toggle wpautop that fix this problem for the front end of the website, but the only way I know how to fix it when switching back and forth between the visual editor and the text editor is with a custom PHP snippet.

    I took a couple minutes to record this short video of how to accomplish this for you:

    In brief, you’ll need to install the Code Snippets plugin and add a new snippet with this code:

    add_filter('tiny_mce_before_init', function($options) {
    	$options['wpautop'] = false;
    	return $options;
    });
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Annoying paragraph breaks inserted automatically’ is closed to new replies.