wpautop can ignore the linkebreaks if you use wpautop( $content, false ); To pass a parameter to wpautop via add_filter, use an anonymous function.
This snippets seems to work for me if I add it to my theme’s functions.php:
remove_filter( 'the_content', 'wpautop' );
$br = false;
add_filter( 'the_content', function( $content ) use ( $br ) {
return wpautop( $content, $br );
}, 10 );
Related Posts:
- Solution to render Shortcodes in Admin Editor
- VERY new to coding – keep breaking site trying to add to functions.php
- Tiny MCE-modifications (plugins) stopped working in WordPress 5.6
- Publish/Update post is changing image links from file url to post url
- Insert image in WordPress with HTML5 tag and caption function
- WordPress functions.php – Execute plugin specific user online
- How to set default post editor based on role?
- Where do I go to edit this area? [closed]
- WordPress wraps span tags into p tags
- Adding tables to the WordPress Editor
- Editor cannot access Theme Options
- Add functionality to post editor
- Remove heading tags on line break
- Limit length of headline in Editor
- When the WP_EDITOR button is pressed, the user is prompted to select a photo from their device
- What’s the difference between WordPress random_int() and PHP built-in function random_int()?
- How to use the do_action () with parameter
- Extending the site search to include a single custom field
- Notify users whenever a new post is published based on their preference
- Remove Header and Footer in iframe
- Formatting post content to exclude gallery
- Why do I get undefined function export_wp()?
- How to remove the embed_footer?
- Redirect if not logged in?
- How to set global variables in template page?
- Setting featured image with function, 1 part not working
- Function to show only first instance of shortcode
- Comments to only be seen by their author
- Using the child theme functions.php to change the customizer.php on parent theme
- Can’t Update function.php after writing short code
- How to get last updated row or ID in wordpress
- Remove function or filter
- options.php problem – data not saved
- Filtering posts by category name based on page’s slug
- adding custom classes for tables
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- How does this function get the id of the most recent post?
- Batch update menu_order attribute alphabetically
- How to create function from code?
- How to use Internationalized human_time_diff() function in Chinese?
- post to subcategory and parent in wp_insert_post
- create shortcode to list users with specific meta key value
- How to add ‘data-caption’ inside an anchor tag
- Execute a ultimate member action when user role is updated
- Search filter by Post title OR Meta Title Value [duplicate]
- Why is functions.php file in child not initializing and over-writing parent?
- Use third party Library in wordpress
- Creating new blog on multisite programatically without hacks?
- Allowing users to view private posts (pending approval)
- Filtering out the #more anchor link that gets produced by
- Exclude from the query posts with meta_key and meta_value
- How to add custom JavaScript in functions?
- srcset and custom field get_post_meta and wp_get_attachment_url
- hide shortcode using hooks
- Adding code using functions.php in child theme
- Extending a custom framework built into WordPress to automatically turn the ‘Search Engine Visibility’ setting ON / OFF, dependant on environment
- Page get parameter doesn’t work with is_single() function
- Filter to wp_list_authors
- Contact Form 7 If Condition
- Javascript not loading after the document ready
- Need to convert image url to a Base_64 data url with wordpress function..
- Add Adsense code between job listings – wp job manager plugin
- How can I change the size of the text in Word Press
- Using depth=n in wp_list_pages
- Modify shortcode to work with custom post types
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- shorthand syntax for custom fields
- How do I pull avatar from post using BuddyPress? [closed]
- Show admin page, only if function is being used
- Get users with different roles and call function on each of them (user_meta)
- Fatal error: allowed memory size when after using enqueue_script
- Show errormessages on wrong username/password on custom loginform?
- How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?
- functions.php pharse error on complete new install
- If has action not working as expected
- Update wp_postmeta table based on 2 keys
- Best practice to call a function from a button-link?
- Disable wordpress update notification
- Class parameter in get_avatar args doesn’t get added to output
- Help using ShortCodes to style whole chunks of the post
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- locking content with overlay/pop up ads
- How to use `foreach()` in ajax call
- Is there is a way to check daily first login?
- delete_user_meta for user in spesific group
- Pagination not working on my archive page for a custom post type
- Remove Featured Images from Posts Older Than a Certain Date
- functions.php filters not applied in AJAX call
- Mail function not working with user accounts
- Function not recognizing page id?
- Conditionally write open graph meta property in header
- Pull random comment from specific post, display on homepage with shortcode
- Adding result from PHP function into an input field
- Using array page name together with page id to deregister script
- Modifying Page-Links format
- Give a function a unique ID
- how to handle multiple forloop?
- PHP error in shortcode [closed]
- comment_post function with js not running
- Problem with removing characters “<” – WpAllImport