Changing the word count on the home page is easy:
if( is_home() )
add_filter( 'excerpt_length', create_function( '', 'return 300;' ) );
Just replicate that code and change the conditional check to add this to other pages. The other option is to just insert the code on the template page (home.php
, tag.php
, etc.), so you know it’s going to be set on the correct page.
Using the_excerpt()
will automatically strip shortcodes and html from the content if there’s no excerpt provided. You can remove these filters, but it makes it much much harder to do word counts when you’re adding markup into the mix. If you want the formatting/text/images preserved, that’s what the more
tag is for. It’s inserted manually because it’s too difficult to automatically figure out in all instances where that break should go.
Related Posts:
- Remove the excerpt and “… Read More” from the featured content on the home page with child theme
- How to end the excerpt with a sentence rather than a word?
- How to remove “read more” link from custom post type excerpt
- View homepage in a preview mode
- Show two different sized featured images on homepage
- Natural URL Design and static front page
- How to use custom Html file instead of wordpress homepage
- Modify ‘Read more’ link adding a new class
- Read more tag shows up on EVERY post
- If its not frontpage
- Landing / Static HTML page
- Changing the homepage
- custom, static home page / landing page with Twenty Eleven theme?
- How to get the original post_id of a static home page?
- “Read more” link doesn’t show up when the post length is under the excerpt length
- Custom excerpt showing first paragraph (with HTML formatting)
- Exclude filter on front page
- How to create an archive for all posts that do not have a post format?
- Different ‘read more’ links
- home.php or frontpage (via settings) for theme?
- Read more on the post page itself
- How can I make WordPress serve homepage to different URL?
- Query string becomes encoded when a static page is used as homepage
- How to link up “read more” on excerpts hack from WP Recipies
- How do I make my single-work page show on my front-page.php?
- query_vars in home, not loading the “home” page
- get_home_path() returning error 500
- Insert Latest Articles in Homepage
- is_home() in HTML head
- How to get the excerpt of a page before more tag?
- How do I make the main page be the blog page and not a separate “home” page?
- Do not show excerpt in post content
- Testing if current page is the static page set as home page
- How do I make the homepage as the blog page?
- When clicking on “home” page from any other page, it goes to IP address and my website doesn’t load
- In db https is used for home, but in backend http is used and cannot be edited
- When does WP ignore content added through the backend editor?
- Overwrite style.css styles from index.php style
- Create a front page template and separate page for posts?
- What does choosing a Post Page do?
- my homepage does not have SSL but another page is ok
- Allow a static page to show on a dynamic home blog page before the posts
- How to move the the_excerpt’s read more link to another div
- How to make a video play for homepage?
- How to get the true permalink of the static home page?
- How to put “Read more” link in Custom Excerpt inside p tag?
- How to show snapchat snaps on my wordpress! [closed]
- Exclude read more in the_excerpt [closed]
- Why does my homepage sometimes shows up in black and white text?
- Excerpt using Read More Tag
- How do I make a page appear like the “Your latest posts” from homepage display options?
- static homepage no longer shows [closed]
- How can I make a portion of the home page user configurable?
- How do I display some posts fully on the homepage, and some as an excerpt only?
- new_excerpt_more link not working properly
- read more, even if excerpt not trimmed
- Give “Read More” precedence over excerpt() word count
- Weird Symbols in Chrome (wordpress) [closed]
- Main timeline in a different path
- How can I confirm I’m on the home page
- How can I show/hide HTML elements if the page is_front_page
- Try to run a function only on Home
- How to wrap “Read More” link in a DIV tag?
- Using a conditional tag for the home page banner
- How can I make my posts on my home page just show summaries?
- Problem with viewing single page correctly. (taken half way down the page on click through)
- Recent posts on homepage
- wp-admin/admin-ajax.php – Slowing My Site down
- How not to show leave a Reply to Home Page?
- Excerpt Is Disappeared
- Automatically set Homepage
- Merging two pages into one homepage
- How do I get my blog posts to appear on homepage?
- How do I make a page the landing page?
- WordPress Home Page
- Read more to open external link
- improve my array to display the_title, category, excerpt for homepage
- index.php isn’t front page but shows as it is
- Static homepage duplicate issue
- Finding the index page using the admin panel of wordpress
- Different banner on home page
- Coming soon page used instead of home page
- Possible to Alternate between Two Home pages?
- Delete Title and Icone in Homepage
- Homepage white screen after migration server
- I want to load a pre-built php page (and assocated scripts/styles/directories) as the front page. How do I go about this?
- Working with WordPress theme
- Make Home page current if there are sub-menus
- Accidentally deleted the ‘home’ page as my front page, can someone help?
- Making draft page as the main page
- Contributors should only access home page
- WordPress truncate posts question (plugin related)
- Remove ‘read more’ link when post is shorter than excerpt
- Show latest posts on responsive theme
- Different URL for homepage then all your other pages
- Fixed home page
- How to make my Home button on the menu redirect to my root page
- Append Second Link to Read More
- On home page remove link from logo
- Twenty Eleven: Home Page, View full post of most recent post & Summary of the rest