One potential issue I see with that is if the content contains Shortcodes.
You can strip Shortcodes before passing it to wp_trim_words
if you want them removed, or alternately, if you want to maintain them you can apply the Shortcodes beforehand.
You may also want to check that $news_item["post_excerpt"]
is not empty, in case a custom excerpt has been entered in place of your auto-trimmed version.
Related Posts:
- How to remove a column from the Posts page
- Hook that get’s triggered when the author of a post is changed
- Allow user to “edit_others_posts” to save only, not publish
- Find out who deleted a page or post?
- Encryption of WordPress Posts
- Skip post in loop and mixin later
- How to put last edited entry on top of the blog-post list?
- My ‘post attributes’ is missing from my WordPress install
- How do I sort (order) the results from `get_children()`?
- Reverse chronology of post listing
- Keep a fluid max number of posts on site
- multicheck box for post metabox
- Archived Posts in Wrong Category
- Get post embedded image caption
- Odd/even class on article tag
- Have save_post write to database image meta [closed]
- WordPress get posts by date without query_posts
- WP_Query only ONE post, won’t work
- Pagination not working on custom query
- Importing New Posts from Live Site into Local Dev Site
- PHP Notice error (when on 404 page)
- How to get posts by multiple post slugs? [duplicate]
- Changing next and previous post link text
- WordPress’ visual editor messing up my (nested) lists (and other things as well)
- Disabled wp-cron, set up system cron but still have missed schedule posts
- I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
- Make view count for pop up post
- add_rewrite_rules for type of post
- Trigger a Link once a new post is Published
- Edit custom post type admin menu link
- Inserting custom data to the_post() during loop
- How can I get the media inside a post?
- How To Hide A Post
- Permission issue with custom post type – not added to menu – by plugin
- Get Page ID of blog homepage
- Get Image tag from content of post
- Visting slug for ‘post’ post type shows 404 not archive?
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Trying to alter the post_content through the_post
- Automatically create a new page daily with last three posts
- Add filter to the end of the post
- How to add a class to each individual post?
- Indirect modification of overloaded property WP_Post::$ancestors has no effect
- How do I change the location of post-specific information?
- ACF to select posts not displaying on blog page
- Benefits to using semantic HTML in post content? [closed]
- How can I insert a new markup element after 4 posts automatically? [closed]
- the_excerpt is displaying excerpts of every post
- Using wp_tag_cloud with only posts published in specific year
- How to remove “» (title of post or page)”?
- Extract wordpress posts content and category content
- Post: how to set created date after post has been published [closed]
- Display Featured Posts Grid on Static Page (Gazette)
- WordPress loop not working on static front page
- Sidebar on single.php not showing up
- remove all custom post created
- Multiple Blog Pages
- Hide content from Post Preview
- How to get the next and previous image title from attachment or gallery?
- Pagination for posts inside a specific category
- Change modified date to current date when title updated automatically
- Creating a redirect option for current page url
- How to edit a custom theme?
- WordPress posts have a different URL to the index
- how to Update guid = “text”+post_name?
- SQL DELETE multiple post_meta on single and multi-sites
- How to put the author of the post in the comments?
- Blog posts pagination not working
- unable to write to the database while uploading images
- Restricting displayed posts to posts from only select authors
- How to Best Create Separate Subscribers and User Experience
- Post not using taxonomy template
- query posts with selected post ids first
- How can I create a Survey Form in WordPress that users can fill in and then submit the entire survey contents as a post?
- How to Make my Homepage Display a Single Specific Post?
- How to display related post from same category in single.php
- Anchor links turn to p nbsp p
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- Using WP page password protection as defacto login
- get current index of post content in category page
- Permalink structure for two seperate blogs
- wp_query args with relation
- 2 Domains, Same Content, Different Titles?
- How do I apply a wordpress function to something with no ID inside an archive page?
- Show author bio box
- Add new post only in assigned category
- Creating Ordered Query using Meta_key
- WordPress each user has each content for a page,how to do that?
- Fixing the WP Post Object for Custom Route
- Changing the Category for all posts of an Author
- Stop images from being displayed on the front-end of the site
- Posts tagged with a-new-tag does not appear
- Add something after all sticky posts in The Loop
- How to show different categories in different pages?
- Query posts from a specific category and selected tag
- Assign certain editors to certain posts
- hypher.js doesn’t work to IE and Chrome
- Order by ‘s’ using WP_Query()
- Adding a post to a page
- Password protection doesn’t prompt for password on pages