You can use the_excerpt()
instead of the_content
Reference link for filter your excerpt : show-first-paragraph
Or you can also do this by callback function inside your loop using the function to modify the_content as below:
function get_first_paragraph(){
global $post;
$str = wpautop( get_the_content() );
$str = substr( $str, 0, strpos( $str, '</p>' ) + 4 );
$str = strip_tags($str, '<a><strong><em>');
return $str;
}
Hope this helps!!
Related Posts:
- get_the_excerpt() not returning anything when post has no excerpt
- Remove links from the_content when using filters wp_trim_excerpt
- How do I pull excerpts from pages?
- Difference between the_content() and get_post()?
- Check if the user has explicitly set an excerpt
- How to override function in functions.php of parent theme?
- Insert Ad Code in the Middle of a Post
- Show Video in Excerpt
- When is wp_trim_excerpt() called?
- Stripping shortcode from custom excerpt function
- Remove images from get_the_excerpt
- Custom page template how to check is_page from functions.php?
- display public excerpt for private post
- get excerpt without images
- Allow latex in wordpress excerpt
- Function to wrap the_content in a div
- Function to show only first instance of shortcode
- Custom excerpt legnths for specific pages
- Automatically insert php function into post $the_content
- Searching for content post
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Using “Read More” link with custom excerpt
- str_replace function in theme
- Adding HTML to the end of every post with the Block Editor
- Inserting a functions output after the content
- How to display post content instead of excerpt
- Add caption functionality to custom WordPress theme
- Using Schema with `the_excerpt`
- Removing permalink from post thumb in twentyeleven
- Custom Post excerpt not working correctly
- Limit length of first excerpt in the loop
- new_excerpt_more link not working properly
- Excerpts are not displayed by a shortcode on category pages
- Add Element as a Filter to the_content
- How to display retweet count and likes in the meta above the excerpt
- Setting a default text for excerpts of a particular category
- Insert template-part inside the content
- Excerpt for pages not showing
- WordPress Excerpt – How to remove the first link using functions.php
- does wp function the_content(); accept another tag inside
- Undefined variable error in new function
- How to remove a specific word at the beginning of the content and add it to the end of the content
- Strip div From Excerpt
- How to change value of variable in theme file with functions.php WordPress?
- The_content and Preg_replace in loaded Iframe [closed]
- Changing where my author box is printed
- Insert Content Before div#main from the functions.php File
- Adding Read More to Custom excerpts
- Limit number of characters in different excerpts
- If is_single in functions.php
- Conditional function for excluding first image from content, not working
- the_excerpt function not showing image
- Appending „read more” to the excerpt conditionally
- Strip all HTML tags from product content and resave
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- $content is empty while using DOMDocument
- Hide disclaimer from summary excerpts
- How to make an If Else on Excerpt Filter
- Shortcode to eliminate and replace with
- getExcerpt: Make ellipsis appear only if character limit is reached
- Function the_content
- need help with ‘… read more’ excerpt in functions.php
- Excerpt length: get 2 paragraphs
- Check if excerpt is empty at loop-portfolio
- How accomplish modification the_content if home/start page?
- Can’t change excerpt length and more tag
- More link – not text
- How to add an excerpt and read more link to a page?
- Adding a filter to my posts
- Excerpt – First Sentence & Read More
- Creating mixture of shortcodes to use in the visual/text editor
- How I can show short content with short tag
- function to show youtube videos within excerpt – if condition and apply_filters
- Load scripts into an AJAX div
- Load scripts into an AJAX div
- HowTo: Add wrapper to columns shortcode?
- restrict uploaded image size and fixed image display size
- Code executes outside of Loop while same code gives ‘Uninitialized string offset’ notice inside a while loop
- Function not receiving string from shortcode
- I’m getting invalid taxonomy in init action
- Using a variable in name of dynamically-called helper function
- Fatal error: Call to undefined function. Underscore me
- Author Page User id in functions.php for non login user
- Is there any requirements to do socket programming with WordPress?
- What is best practices to move the following code into a function?
- Why am I losing image quality on my site?
- How to add widget in main menu
- Replace image attributes for lazyload plugin on image elements with specific class
- Correct way of Enqueue self hosted fonts in sass project
- function syntax is off,
- Taxonomy On Index Page
- Adding A New Widget to WordPress Disables the Existing Widgets
- How to trim content AND retain HTML?
- Function image_send_to_editor returns emty title tag
- Including admin-options.php file in Child Themes
- I see edit instead of read more
- WordPress hooks to call a function inside a construct
- Modified functions.php in Magazine Pro theme of Genesis. 500 error
- require_once() Causing categories and tag pages on dashboard to not refrsh
- How To Show Shortcodes In WordPress Custom Fields?