EDIT
OK, there is a very hidden native function, get_extended()
that I never knew about and greatly explained by @kaiser in his answer. My answer should only be an extension to the answer by @kaiser
ORIGINAL ANSWER
There is no native function to do this. The best here would be to use a PHP function like strpos
to search for the more tag, and then do something according to the result.
You can try something like this
if( strpos( $post->post_content, '<!--more-->' ) ) {
the_content( __( '… Read more about this article <span class="meta-nav">→</span>' ) );
}
else {
the_excerpt();
}
Related Posts:
- Get excerpt using get_the_excerpt outside a loop
- How can i display the content in plaintext
- Exclude filter on front page
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Content/Excerpt length control for a specific loop?
- Can I use both a custom excerpt and a trimmed excerpt?
- Combining the_excerpt with the_content
- the_excerpt not showing posts
- Using get_the_excerpt() Before The Loop
- Unable to change the “Read more” text inside the_excerpt
- How to get the excerpt for is_home() outside of the loop isn’t working
- “the_excerpt” in loop just keeps repeating first post?
- Only Show Excerpt After First 3 Posts
- Excerpts not showing on main page
- Excerpt isn’t working or am I missing something?
- to get a little more content after ‘read more’ inside loop
- Limit article to 100 characters. Can’t use the_excerpt…
- Return only content in excerpt field in loop
- How to add excerpt in loop in Twenty Eleven theme?
- Counting the posts of a custom WordPress loop (WP_Query)?
- Get post content from outside the loop
- Is there any difference between the_title() and echo get_the_title()?
- Multiple Loops Homepage?
- Why is it necessary to call rewind_posts() when using the loop more than once? [duplicate]
- Is including the loop necessary for page.php? [duplicate]
- Identify the page being shown while in The Loop
- How to find meta_values to call
- Alternate loop output every three posts (within the same original loop)
- Previous and Next Post link doesn’t work
- Random post, page inside post loop problem
- In a foreach loop, how do I target the last item in the loop?
- Users instead of posts: How to modify the main query?
- single page site with subpages
- Different Queries Return Same Results [closed]
- wordpress simple loop, huge issues
- Pagination gives extra page with no results
- Better way to display posts from specific categories, in a grid layout
- Infinite Redirect Loop after moving to subdirectory
- Loop after page content
- WordPress Loop – Not returning projects in specific category
- Next and Previous loop
- add most viewed post by google analytic in loop [closed]
- Query reset problem or flawed code to enable custom post type query
- Sort posts by most recently modified
- Exclude posts from main loop based on meta value
- Using an ACF field from a page within a post loop?
- trouble calling an import class from an action in a plugin before wp_cron executes
- Blog page Server error 500 with stick post loop in query.php
- How to fix pagination for custom loops?
- Show all posts using the template page and the loop?
- ‘Auto Draft’ Post showing in wordpress loop
- How do I display an image before the first post of the loop when I’m using get_template_part?
- Why does `inclusive` not work in this wordpress loop?
- Multiple get_posts() queries on one page
- How to get the post excerpt using post object?
- Custom loop not working
- Loop inside query
- In Custom page – next_posts_link Not working while previous_posts_link is working
- Escape current post from loop
- Why isn’t my multiple loops working?
- How can I display other user avatars on an author profile page?
- something strange is happening to my code
- How to modify search.php to not show pages only show posts
- facebook like, tweet and google+1 buttons inside the loop on home, archive and search pages and missing facebook like buttons
- Loop Offset for tag based “Related Posts”
- How do I put my frontpage featured image in a page template for home.php?
- Randomly display post based on meta value. (Kind of Priority/Weight)
- How to print redux gallery feilds id? [closed]
- Why the first with flexslider appears as blank on my code?
- Rendering pages
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- WP_Query is only looping home page, not pages
- How to filter posts by category INSIDE the loop
- static page with multiple loops breaks post pagination
- new custom theme – posts displaying on top of one another
- Help with if and else statement
- Building a form with WordPress, and also pulling that data for a user page
- Adding a second loop breaks everything
- Custom Query with Sticky Posts
- is it bad to copy the loop for a template?
- I want to load post in bootstrap Modal dynamically
- Why my loop is repeat?
- Return only one post format in index.php [duplicate]
- How to display just video post format?
- Is it possible to get a post ID of a 2 different custom post types loop embedded in the same post to perform update_post_meta from the frontend?
- Loop shows post 5 times in a query
- How to execute custom loop before loop content?
- Make custom WordPress comments list
- Sorting posts to make those with post thumbnail show up first
- Best way to check if a post with specific meta exists
- Default Template infinite loop of Title
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- Change the way wordpress outputs images or image galleries
- How can I access ‘key’ and ‘value’ from an array in a for loop?
- Error in Wordprewss loop for page template [closed]
- Tags outside the loop
- How to get files from loop for zip
- Divide loop into several columns based on post custom field and enable infinite scrolling
- Query Loop Block: possible to restrict just child pages?