I’m assuming ‘Archive Page’ is a custom template and not either of the WP archive pages (category/date/author/tag/taxonomy). Try using this:
<?php
add_filter('the_content', 'trim_content');
function trim_content($content)
{
if(is_archive())
{
//use your own trick to get the first 50 words. I'm getting the first 100 characters just to show an example.
$content = (strlen($content) <= 100)? $content : wp_html_excerpt($content, 100);
}
return $content;
}
I think this will do the job.
Related Posts:
- Manual excerpts for pages not working on Search
- How to get post or page excerpt using post_excerpt
- How do I modify this page template to show subpage excerpts (not post excerpts)?
- How to get the excerpt of a page before more tag?
- How to echo excerpts with wp_list_pages?
- Displaying page content in category archive (archive.php)
- Page redirects to archive
- How can I use “getarchives_where” to get monthly archives for static pages?
- Custom page in archive page for certain category
- Styling Previous/Next Pages differently from Index
- How to store archived copies of a WordPress site
- Use an archive as the parent of a page?
- Page Slug Won’t Change – Can’t Edit Archive Page With Slug or Reassign Slug
- Bundle a page with custom url and a function
- Display inner pages like posts.[Like how post excerpt works]
- Set order acs and no paging for archive page
- Create page excerpts for landinpage
- Create custom archive page for individual authors which is separate from the author.php page
- simple category search form returns full text – but I need excerpts
- Archive with specific keyword by category sorted by date
- Static front page with excerpt
- Load new Posts on Scroll on Page
- Custom wp_list_pages() function
- Edit the text location of a form
- What is the difference between $paged and $page?
- Custom SQL Query for WordPress page
- Change admin startpage to Pages-page?
- How restrict page for users logged? [closed]
- Only allow new subpages to be created
- Hide Visibility Option From WordPress Publish Metabox
- How to make nested page structure?
- Redirect to a page if ancestors is empty
- Get Order of Meta Box in a Page/Post
- Modify Page Title before output via wp_page_list
- List Child Pages of Parent Parent Page (Child pages from Grand Parent)
- How to add meta boxes to Pages
- Overriding the currently selected menu item
- Missing parent page attribute
- Hiding Page by Title from Editing
- Two Search pages, One search form
- Why doesnt ONE of my links in the footer work properly? [closed]
- Create subpage – filter parent pages list
- Use lots of pages, or categories/posts?
- How to have custom tinyMCE buttons break onto next line when too long
- Get page by its ID and display it on another one
- How do i change page template in bulk?
- Determine page content based on page parent
- Weird issue with is_pages() with array
- How to show the root webpage on all subpaths
- category slug and page slug same
- New user Registration data imported into Page
- Could be a namespace conflict (?) with login form and register form on the same page
- The concept of non-blog content
- Loading Multiple Comments Pages via Ajax?
- Change base URL of pages created by certain users
- Remove Content edit box from ALL pages (not posts)
- What is full URL for a post?
- How to list a page tree?
- How to create a page and display only the posts with a specific custom field value?
- Remove comment section from new page
- WordPress pages not working out correctly with HTML
- Change page name in admin list
- Dynamic page with comments
- How to rewrite a page url
- Manage content on multiple pages synchronysly?
- Display pages in alphabetical order
- Print page content with formatting when doing custom SQL query
- get_page() – Only variables can be passed by reference
- Need Help with Custom ModRewrite
- How does wordpress link page templates to individual pages
- Is there a template tag/function for getting the URL (or slug or name or ID) of the blog page when using a “static” front page
- Problems in creating a static site with WordPress
- Creating new page/tab in groups section not working! [closed]
- Prompting for review / reapproval of page content
- Limit the amount of main pages
- Add separate list of pages under Admin
- Custom user tables not working after migration
- remove “Edit” from select pages
- Add custom action to the page listing screen
- How to list pages from an author?
- Cannot update page – with too many characters?
- Share a folder with files
- Front Page post mirroring revisions to other pages, constantly updating itself
- Is it possible to embedd this web app to my website [duplicate]
- Using external DB within wordpress
- Microsoft Security Essentials is blocking my WordPress website in IE11
- Author information on all pages
- Pre-populating new Page creation with shortcodes
- WordPress Pages “allow comments” meta option can’t be checked
- Loading internal page
- Firing page_publish where page is child page
- Add role and edit page capabilities
- Google indexed pages for one page site
- WordPress, page 2 shows the same posts as page 1
- Parent for a single (single.php)
- Create a new page for each form selection
- pagination does not work with query_posts. Help! [duplicate]
- Subpage Conditional
- How can one get page by pagename if it is a child page?
- How to pass the Querystring in pages?