Use the function t5_word_count() from this answer and extend the method widget() in your widget class:
public function widget( $args, $instance )
{
if ( ! is_singular() )
return;
$content = get_the_content( '', TRUE );
$words = t5_word_count( $content );
if ( 50 > $words )
return;
// print you widget
}
Related Posts:
- How to get post ID of the current page/post inside a widget?
- widget should display post archive by year and on click also by month
- Which file displays the date archive?
- Get all posts by post_author
- How can I display widget in a Page or Post?
- Ajax load more button in Recent posts widget
- I want to display custom text widgets for each post in the sidebar?
- remove post and categories/tags count from right now dashboard widget
- Widget that shows categories with posts numbers
- Getting Duplicate Posts on Home Page with Widget Added Between Posts
- Display current post position in Elementor Posts widget
- Custom posts listing widget always returns 1 extra result
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- Load widget only on blog posts
- Widget to show posts in the sidebar basing on its IDs
- How to show multiple posts thumbnail, title and date in widget
- Move position in post list for a custom checkbox column
- Add checkbox in admin post list – show checked post in widget
- Create a List of Widgets, where each widget holds three attributes
- Custom Fields – How to get the list of a specific active widget each time it rendered
- How do i bring out post category name in my widget?
- post__in no longer works in wordpress 5.0.3
- Posts on Sidebar only
- How do I create a ‘selection’ criteria list’ that will then dictate which posts are generated when the user presses search?
- Creating widget – ask for selecting a post in the admin panel
- How to display most popular posts from certain category in sidebar?
- Post List Widget with custom posts and editing the Read More Link
- Hide first blog post in content and output it in widget
- How to use in_category?
- How can to use the players from the Media Widgets in the body of a post to play audio and video files
- How to have more post in a page than in your home page
- How to add a widget area between blog posts in Genesis Framework?
- wordpress pinboard theme [closed]
- Output number of WordPress posts remaining until a post milestone is reached
- Image inside the content is replaced with featured image from my older post
- Avoiding “Missed Schedule” errors when inserting future posts
- How to get posts from a current post’s month?
- Gather posts into a cart/lightbox and share with another user
- How to display two random-post sections that are each under their own category
- Using setup_postdata() with multi-dimensional array
- Show metabox value last post excerpt, title and link
- Tags on products vs tags on blog posts. An easy way to duplicate them
- Deleting post specific content at beginning of post
- Change Post Title For Specific Category
- How to display the requested post only?
- Export all posts to import as product items
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Display Parent Category of a Post belonging only to Subcategory
- Prevent duplicate pages from being added
- Can I style single post that are in multiple catergories?
- Show 10 latest posts only from users with contributors role
- Mailing list submission from a post that doesn’t have a form on it
- Older blog posts not showing up on WordPress
- Embedding Post Editor Into External Site
- Show single post child category from a determined parent
- How to show posts in grid style on search result page?
- My website is showing today’s date instead of published date since db migration to a new wordpress
- How can I change the date format of the revision list?
- Go back to the exact post page number
- Pagination Stops
- How to mark only one post as Featured post?
- Remove status ‘archived’ from the default post and page view
- How to invoke a HTML custom button based on a HTML dropdownlist menu
- Parent menu item does not display posts when I add the sub-items
- Post data across WordPress sites
- Mix post date with post meta value using WP_Query
- Custom Post Types and Broken Permalinks
- The first post appears twice
- Find post tags words in post content and link them to tag URLs
- Check if user has avatar
- Can the_post_navigation() be outside of the loop?
- How can I filter the post of a CPT by taxonomy Term in admin meta-box dropdown?
- Show Posts By Custom Field
- Hide title in Merlin Theme on posts and pages only
- Custom plugin to get related posts by category
- is_archive() not working on selected “Posts page”
- Relative Image Urls in Posts are starting from root – Not from WordPress Address (URL) at General Settings
- How to associate media with a post?
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Apply comment to different post (not the current post) [duplicate]
- When Author add new post change default status to pending
- Adding custom fields to the Quick Edit screen – puzzled about the column concept
- fire action when post is being edited as well as saved?
- How can i add new post on new page
- How to separate metabox data in front/backend
- how to style an individual page in a category [duplicate]
- get_posts includes “auto drafts”?
- ‘posts_per_page’ => ’10’ does not show any post
- Page not found after clicking on pagination
- Enqueue CSS on custom posts’ backend area
- exclude certain categories from posts
- post_count not working
- Hide post title when single post with specific category
- How to add a post option in wordpress like facebook [closed]
- How edit footer copyright info? [closed]
- How can I customize sections of the homepage layout?
- How to remove category and other tags from posts page
- How to remove slug from CPT correctly?
- Download button under all images WordPress
- How can I guide user to the next unread post within category