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
- Is it possible to remove the “standard” post format?
- Warning/Notice about functions.php
- Is checking whether the blog is installed necessary?
- Using separate .php file for functions – how to run on site?
- Access Plugin data from Functions.php
- how to call a function only in specific pages and exclude it from other pages
- Error when adding excerpt to the content through functions.php
- Add dynamic links in WordPress custom theme
- Attempt to change jQuery version caused White Screen of Death
- Difference b/w Simple function call & do_action call
- Filter yoast canonical add_action priority [closed]
- Should I store functions in separate folder?
- the_password_form functions not working together
- PHP 7.1 | Warning: A non-numeric value encountered in
- Way to redirect all Product Sub Category to its Main category Page?
- Get term slug by term id and then explode it
- Shortcode question
- call_user_func_array() expects parameter 1 to be a valid callback, function
- define css class in functions.php
- Adding tables to the WordPress Editor
- Add Login and logout buttons to top menu bar
- implementing a centralized content “show-do-not-show” toggle?
- Add a word after the post url if it is within a specific category
- Security when outputing wp_oembed_get code
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- What to do to have access to WordPress functions
- Remove theme, change theme button and WP version on “Right Now” admin dashboard?