the_content() and the_excerpt(), unlike their ‘get_’ brothers will process the content through some functions, one of them is wpautop() that will add p tags for you. To get the same formatting for both excerpt and content:
if ( has_excerpt() ) {
the_excerpt();
} else {
the_content(__('Read more'));
}
Related Posts:
- Replace full content with an excerpt
- How to have a “clean” post content, for excerpt and social networks sharing
- Hide specific content from excerpts
- Displaying latest Posts – fixed height – Excerpt vs. Content?
- the_excerpt() in content.php and get_template_part() in single.php
- How do i configure my content to show full posts?
- How to show content for posts of a specific category only
- Display a paragraph in the index page that won’t be displayed in the single post
- Best practices for localizing WordPress content?
- if the post has content
- I want to have my custom field use HTML, how do I do that?
- What’s the Best Way to Structure a Multi-Content Blog?
- How to Handle Distributed Development Workflow
- Recommended Books on WordPress for Management and non-Developers?
- Total word count for posts by one author
- Neither the_excerpt() nor the_content() works properly?
- Get Content From Blog Page
- Show content after the first and second paragraph
- How do I make certain areas editable?
- What server settings are required to import WordPress XML file
- append_content help
- How to limit post content and remove image caption from it
- Is there a way to trigger an automatic import of a WP backup on creation of a new WP multisite site?
- Hiding posts and pages in panel
- Convert all youtube link to embed
- wp_insert_post iframe missing
- Grabbing specific content
- Does is_user_logged_in() block search bots?
- content gets scrambled
- Conflicting post edit options under dashboard
- Disable external (3rd party) CALL (images,fonts..) in Dashboard
- Get the content inside shortcode and apply external function to it?
- Can somebody tell me how I am supposed to be using blogs.dir for network / MU sites?
- Is there a way to show only the text editor
- How to make author box like this & add after every post?
- Extract an embedded video from the content
- Error when adding excerpt to the content through functions.php
- Doctype printed on the page content
- Main WordPress site with several flexible clones
- Post Format Default Content
- Post titles below the post format content
- Show image on the left and content on the right using ul li
- Problem with content – not loading
- Text with special class as excerpt (or exclude special class)
- The_excerpt() doesn’t parse – how to change that?
- Trimming a custom field to a length
- the_content() returning null in one category only, even though there is content
- tabbed content box with different tabbed background images
- Split the_content into two parts
- Page content not visible in backend
- Body-only page for a 2-page form [closed]
- Changing theme removes page content in dashboard’s post main editor
- Divide post content in three columns
- Website showing random code like texts in a post after pasting from MS Word
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- Simple Math Quiz or Captcha to hide whois query form
- highlight specific text in the content box
- Filtered content appears in the excerpt
- the_excerpt function not showing image
- What is the best practice to localize content? (Geographic not langauge)
- Duplicate content with incremental titles. How is this happening?
- Upgrading to WP 5+ with block content – Export & Import Page Content
- Related post not showing table of content
- Images over HTTPS endless issues – mixed content
- Printing first line of content in wordpress
- Custom slugs for Each Tab
- Using Elementor to get dynamic content for wordpress on a predefined theme
- Content export, reinstall and content import
- Display Full Content Instead of Excerpt
- Open content directory help!
- Need help with invisible content block
- Excerpt being limited too early
- Excerpts not showing on main page
- How to get the list of posts with empty content
- preg_replace style attr in $content and Editing post_content before saving
- Retrieve content of page by URL Parameter
- Nothing appears using get_the_excerpt() in category.php
- Need help for showing same front content page, search page and portfolio post page
- Wp Some Pages content Not display in editor after move live server
- to get a little more content after ‘read more’ inside loop
- Add video tag to youtube link fron content
- Having a strange wordpress issue where content does not load when past a certain amount
- How to embed PDF files inside content without media_send_to_editor?
- Update content on the fly
- Visual Editor not working for user on multiple computers
- Migrate bbpress content to posts
- Get content or excerpt of top rated votes @GD-Star Rating? [closed]
- How can i show only 30% of the “the_content(“More…”)”?
- My UPDATED content ONLY shows when I am signed in.
- Built-in Method to Extract Embedded Video from Content
- Content in footer file
- How can I add more code to this?
- How can I define the RSS feed content length?
- Best way to modify content from index.php to single.php?
- Is it possible to set the upload location to a different server?
- Display content based on an event
- Iframe only visible after log in
- Post content not showing
- How to use str_replace() outside the loop?
- Mixed Content removal from WordPress, can someone please help me with the details on how to fix it