WordPress has a helper function built into core, wp_trim_words()
, that was added in v3.3.0.
In your case, simply replace the_excerpt()
with echo wp_trim_words( get_the_content(), 80 );
where 80 is the number of words you want.
Related Posts:
- Custom Post Type Settings page, choose page to display archive
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- WordPress custom post type archive with description
- Custom post type is showing custom home page, not archive page
- Custom post type archive page blank
- My archive-posttype.php template is not loading
- Custom Post Archive is not working
- How to integrate single and archive templates for custom post type in any WordPress theme
- Custom Post Type Archive template not being called
- Is possible register two archive pages for single custom post type?
- Archive page of CPT’s custom Taxonomy
- Finding the CPT archive template source
- ACF Pro Accessing fields on a Custom Post Type
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom post type archive page not showing on archive-posttype.php
- Custom post type with two templates
- How do I make my archive page look like popular reviewing sites (e.g., Polygon and Gamespot) [closed]
- Display custom post type archive on page.php template
- Making a archive gallery page for a custom post type which already has an archive page
- Pagination not working only on Archive-Name.php using new WP_Query
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
- Create a custom archive page for a custom post type in a plugin
- Custom Post Type Archive Page not showing
- Loading custom page template via plugin
- Page is defaulting to archive page and not designated template
- custom post type archive page url to point to Page permalink
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- Add Settings to Custom Post Type
- Custom post type permalink structure with the category also acting as an archive
- Custom Post Type Works but Still Shows “Page Not Found”
- Rewrite custom post type url’s adding meta box values
- I can’t set meta_key in my custom post type query
- Archive page for taxonomy of custom post type
- Add meta data to the custom post type ARCHIVES page
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- Custom query variable – get wordpress to redirect to nice permalink url
- add_rewrite_endpoint() and Custom Post Type Archive
- Custom post type archive page pagination
- Add custom post type archives to search results?
- Navigation menus not showing because of custom post type filter
- Second Custom Post Type Archive
- Rewrite URL for only archive page (custom post type)
- How do I get the permalink structure to work like this?
- Archive slider for CPT
- is_main_query() not working for WP REST API
- WP_Query | ‘post_type’ doesn’t work
- Editable Meta Data for Custom Post Type Archive Template
- Archive template for custom post type only lists first 10
- Archives for Custom Post Types (without Pages)
- Set up Custom-Post-Type Author Archive
- Custom post type templating problem
- Why is my site using index.php instead of archive?
- Single post with a Custom Post Type returns 404, when archives of the CPT work correctly
- Creating a Custom Post Type
- Custom Post Type slug same as page name
- How to set up Custom Post Type archive page as Front page
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- ACF for custom post type archive pages: which hook to use?
- Custom post type permalink uses archive page to display posts
- Show categories of custom post type and not all posts
- Removed custom post type archive page shows blog page
- Custom Post Type with Configurable Sidebar via ACF
- Plain links in single-class.php and archive-class.php not working
- Archive page for custom post type and custom taxonomy
- Pagination does not work on Custom Post Type archive while trying to get load more function working
- How do I override the default number of items to be listed on an archive.php page? [duplicate]
- Create a Custom Path to Archive
- Best way for a plugin to define a custom post type archive template?
- Specifying a template for custom post type pages
- How to set a ‘page’ as parent of a custom post type?
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- 2 Custom Post Types In 1 Archive Page?
- Custom post type archive URLs with a single taxonomy
- Different number posts per page based on custom post type term id
- How to change URL for custom post type archive?
- Custom post type author issues
- Do not show child pages within a file page
- Custom taxonomy with custom post type archive page
- Custome post type “tags” pick default archive instead of custom post type archive
- Customize url from the_terms
- Iterating over custom post type archive returns incorrect first ID
- Want to display my custom date archive to date.php but dont know how
- Help with Multi Level Category Archive Page
- Highlight a Post on archive page if it has a new comment?
- Pagination fault in custom post type archive page [duplicate]
- How to assign custom post template to its custom taxonomy terms
- Permalink of custom post type partly broken
- Custom Post Type Archive Links Not Working
- CPT archive as home page
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Archive page of filtered posts
- Why is this custom post type defaulting to archive.php?
- Archive Page Pagination not working
- Custom taxonomy archive page not routing?
- single-mySlug.php works: archive-mySlug.php does not. Custom Post Type
- has_archive for default post type
- Pagination for Custom Post Type with Multiple Types
- Custom Post Type Archive Title Lowercase
- Pagination not working on custom post type archive
- Best practice to display a list/archive of Custom Posts in a Page Template