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
- 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
- Landing / Static HTML page
- custom, static home page / landing page with Twenty Eleven theme?
- “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
- 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?
- 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?
- Testing if current page is the static page set as home 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
- 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
- How to move the the_excerpt’s read more link to another div
- 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]
- Excerpt using Read More Tag
- How do I make a page appear like the “Your latest posts” from homepage display options?
- 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]
- 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?
- wp-admin/admin-ajax.php – Slowing My Site down
- How not to show leave a Reply to Home Page?
- Automatically set Homepage
- How do I make a page the landing page?
- WordPress Home Page
- Static homepage duplicate issue
- 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?
- 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
- 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
- Append Second Link to Read More
- Twenty Eleven: Home Page, View full post of most recent post & Summary of the rest
- Problems with homepage in different browsers
- Filter Post Title without affecting screen-reader-text
- After upgrade my WordPress version 5.4.4 to 5.6, I can not set my homepage
- How do I get the Revolution Slider in the header on the homepage, but not the blog index page?
- Timeout when loading Home Page, correctly load other pages in front or admin
- Remove Home page slug in translated pages
- the_excerpt() is not trimming at
- Cannot figure out how to add a read more link to a manual excerpt. Please help
- ‘Nothing found’ on home page after custom CSS edit
- Why 2 home pages?
- Homepage was doubled and cannot be adjusted in Elements
- Homepage Setting missing
- How Create Different Layouts For Single WordPress Theme?
- homepage not fully loading after loutout
- div show on home page only not in paged
- Automatically change home page [closed]
- Edting Homepage text cannot find in homepage
- How to get different homepage layout, based on the URL and customizer
- Which file is the theme index page?
- My blog index page shows the last post as a title?
- Homepage only shows URL after moving to different server
- Read More in the actual excerpt
- Define excerpt length by inserting read more tag
- Style post formats differently on the home page
- Change header when on home page
- Using pre_get_posts to filter by custom fields while using static front page
- Can’t change excerpt length and more tag
- Home in page/post not refer to homepage
- multiple excerpt length and styles
- WordPress excerpt for specific posts in category
- get_posts displaying wrong permalink for “continue reading” link
- blog page showing as home/landing page despite template change and reading settings
- Hompage showing page from different theme
- How do I edit my WordPress front page which doesn’t show in the admin pages area?
- Is there a way to display the ‘Read more’ link if it’s within a range?
- I have front error for open website [closed]