why don’t you use get_the_excerpt instead. That doesn’t have the paragraph marks.
You can even use your own filters. something similar.
<?php
$my_excerpt = get_the_excerpt();
if ( '' != $my_excerpt ) {
// Some string manipulation performed
}
echo $my_excerpt; // Outputs the processed value to the page
?>
view more on the codex
https://codex.wordpress.org/Function_Reference/get_the_excerpt
There is a the difference between get_the and just the excerpt. Returning excerpt with out “get” automatically includes the echo. It also cleans the result and adds paragraph marks. If you want to manipulate before returning you need to “get” the excerpt content, manipulate, and then echo it.
So use
<?php echo get_the_excerpt(); ?>
Related Posts:
- Add popup window to TinyMCE buttons
- TinyMCE editor is breaking my beautiful HTML
- How to replace the content of tinyMCE editor in both text and visual mode using jQuery?
- wp_editor disable after reaching character count limit
- Is it possible to create nested lists in the WYSIWYG editor?
- TinyMCE Anchor Button not showing
- How to keep non-breaking spaces in the visual editor?
- Is there a way to prevent the Editor from modifying my HTML
- How to disable TinyMCE 4 keyboard shortcuts
- How to customize the symbols that appear in the Visual Editor insert custom character
- Pasting code into pre-formatted text in Visual Editor not working in 3.3.1
- Add Shortcode inline inside Gutenberg block
- How to make WordPress and TinyMCE accept tags wrapping block-level elements as allowed in HTML5?
- Visual Editor freezing on text highlight since 4.3
- tinyMCE duplicates previous block element when pressing return (visual editor)
- WordPress visual editor broke due to non standard port?
- Customising the WordPress TinyMce editor and it’s buttons
- Enable Visual Editor In Comments On CPT Edit Page
- Text cut off after the character 𪇆 in TinyMCE
- Adding image to visual editor popup for shortcode with wp.media and wp.mce: changing image duplicates shortcode
- Change Default Font Size and Remove Unwanted Font Sizes in TinyMCE
- TinyMce in WordPress – Getting the “fullscreen” button to stay on the right when customising button layout
- Added custom styles to Visual Editor. Classes are appended and not replaced as intended
- Preserving tabs and line breaks in when switching from HTML to Visual Editor
- How to disable formatting
- Add table button in editor without Plugin
- Make Textarea a TinyMCE (editor box)
- How to get line breaks to translate to paragraphs?
- TinyMCE Visual Blocks plugin set Show blocks option for all users
- Custom TinyMCE style formats disabled
- Visual editor not showing all table rows
- Is it possible to disable the image alignment options in the post editor?
- Open Insert/edit link popup
- Change syntax styling of TinyMCE HTML Text Editor
- More than one TinyMCE (wp_editor) with different $settings[‘drag_drop_upload’] values breaks
- Customer Support: TinyMCE stopped working (on some computers)
- customize tiny MCE blockqute
- Keyup events in tinymce editor not working
- How to force insertion in editor
- Stop editor from adding “amp;” after every “&”
- Visual Editor is blank – 404 for plugin js
- Visual composer causing conflict with TinyMCE [closed]
- TinyMCE: Move buttons from 2nd row to top row
- enable TinyMCE for comment forms
- Best Browser for Editing Posts
- TinyMCE strips off the href tag inside span, if i change from text to visual
- Adding a Media Button to the WordPress Content Editor
- clasic editor – article categories customization?
- How can I change TinyMCE’s default block format?
- Load WordPress Editor .css on Front End
- “Formats” Select Menu in WP Editor doesn’t show up with correct colour
- Adding microdata using Structured Data Markup Helper HTML
- How to modify VisualComposer’s TinyMCE editor only for a specific shortcode
- Preventing tinyMCE from auto formatting selected blocks of content
- wp_insert_post() dont post content like i need it :(
- WordPress Started Executing Code Inside PRE Tags Even They Are Properly Escaped
- Stop editor from removing tags and replacing them with nbsp
- Possible to stop WordPress from adding p1, p2… classes to p tags in TinyMCE?
- Custom Tiny MCE button to bring up a custom php popup
- Add unique class or ID information to tinyMCE
- Apply custom style to single word in WordPress
- How to keep a textarea and stop tinymce?
- TinyMCE Editor Set Default Tab
- TinyMCE – Show Advanced Options (2nd Row) By Default
- Can I remove the Rich Text box editor for a specific post?
- Count Words using tinymce in the front-end
- TinyMCE – Add class to OL – selector doesn’t seem to get parent OL,UL, just LI’s (4.6.3)
- TinyMCE Keyup Function
- Hide TinyMCE controls in TinyMCE 4 (WordPress 3.9)
- WordPress editor strips out anchor tags when they appear on their own line
- Sortable WYSIWYG editor
- Getting selected (highlighted) html from the Visual Editor on Edit Post page?
- WordPress Admin Not Loading All Core Scripts
- Prevent the Editor From Moving My
- TInyMCE object Tag stripped
- Popup box when Clicking on Insert into post button in wordpress
- Documentation for adding a tinyMCE view for visual live preview of custom shortcode?
- Tiny MCE doesn’t look anything like my blog
- TinyMCE – no auto formatting using the_editor()?
- Sanitizing textarea for wp_insert_post with TinyMCE enabled or disabled
- Getting shortcode attribute values and shortcode content with JavaScript regex
- Allowing style tag in TinyMCE editor
- remove WYSIWYG editor but keep media button
- WordPress Tiny MCE won’t accept line breaks
- wp_tiny_mce function not found
- TinyMCE function causes issue in AVADA theme
- How to get values from Tinymce visual editor popup?
- WordPress Editor without buttons
- Visual editor popover or placeholder
- wp_editor Too Tall when Content is Loaded
- TinyMCE HTML Encode Backslash
- Revealing ‘code’ hidden button in TinyMCE4 and WordPress 3.9.x
- regEx wp core file
- Adding New Row of Custom TinyMCE
- Using TinyMCE fiddle for node filter to add id attribute to anchors
- WYSIWYG with HTML source?
- How do I separate my theme’s styles from editor styles?
- WordPress and TinyMCE Advanced: Failed to load javascript
- tinymce “Link” popup throwing error, not working
- install tinymce plugin [closed]