Try using $post->post_excerpt
instead:
// globalize $post, just in case
global $post;
// find out if the post has a defined excerpt
$data = $post->post_excerpt;
// If so, output something
if ($data) echo "<div class="excerpt">$data</div>";
This method will bypass the auto-excerpt generation inherent in get_the_excerpt()
.
EDIT
By popular demand, the same code, using has_excerpt()
:
// find out if the post has a defined excerpt
$data = ( has_excerpt() ? get_the_excerpt() : false );
// If so, output something
if ($data) echo "<div class="excerpt">$data</div>";
Related Posts:
- Twenty Eleven home page show only excerpt
- How to call the_excerpt() with tags or the_content() as an excerpt?
- How to programmatically bring back “excerpts” field in post editor in WP 3.1+
- How to hide and content from auto-generated excerpts?
- the_excerpt() not showing manual excerpt for Pages
- Bold letters inside excerpt [closed]
- How to move the the_excerpt’s read more link to another div
- buddypress: how do i make the group description excerpt shorter?
- the_excerpt(); tag not working
- How to make the excerpt_more filter apply to the actual post excerpt?
- How to obtain a reference to the_excerpt() from custom loop
- Exclude read more in the_excerpt [closed]
- Custom get_the_excerpt() only works on first post
- excerpt() shows different result between remote and localhost(development environment)
- adding class to excerpt
- Get Post’s Excerpt Without the Wrapping tags and the Read More link
- Single.php the_excerpt loads same as the_content not loading read more line
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- matisse theme show excerpts not whole content
- restrain filter on get_the_excerpt to queried item in stead of current post
- How to make force_balance_tags balance comment tag
- Filter URL and shortcodes from the_excerpt
- Why is wp_head() creating a top margin at the top of my theme header?
- What is $post_id? is it a global variable in WordPress?
- How to limit wordpress menu depth in admin panel
- How can I set image sizes and still have responsive images using the srcset attribute?
- Call dynamic_sidebar but include/exclude named widgets?
- Possible to “Attach” images to multiple posts without inserting or uploading twice?
- Remove settings if theme is deleted?
- Adding customizer styles with wp_add_inline_style
- Adding widgets programatically: how to avoid collisions?
- Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
- How do I get a parent theme modification from a child theme?
- Removing the default sidebar from admin panel
- How to display category specific post content on a page
- Is there any need to use both wp_reset_postdata and wp_reset_query together?
- how to pull wordpress post comments to a external page
- Enqueued Stylesheets Effecting Admin Styles
- How to change the customizer´s sidebar width?
- Why is $GLOBALS[‘content_width’] needed if site is responsive?
- How i can get widgets areas working in customizer?
- Theme development question regarding layouts
- Using wp_tag_cloud(‘format=array’) to print tag names without links?
- Link to a .po file in a child theme
- Alias to theme folder for local development
- My Admin bar covers my sticky navbar [closed]
- Responsive embed for the video shortcode
- Access theme options in templates
- How to show post from category select
- Any dummy content I can use for development?
- Font Awesome 5 Free – far working but fas is not? [closed]
- How to remove header image in Twenty Eleven theme?
- How to create a fixed header and scrolling content area
- Edit value of the_content() before showing
- is_home and is_frontpage always true
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- WordPress linking
- wp.media issue with selected image
- Why does admin-ajax load slow and what are ways to speed it up?
- How to style bootstrap container in wordpress theme?
- Wamp Server error on running wordpress theme on localhost. How do I fix this error? [closed]
- searchform.php doesn’t work properly
- Shortcodes do not work in own template
- Adding Bootstrap to WordPress TwentySixteen Theme
- What are the allowable Tags values in a theme file header?
- Following/tracing page construction through theme PHP
- Get themes’s images path in WordPress Multisite
- my single.php is mixup on some post for no reason
- altering search terms
- Creating a theme update notification api [duplicate]
- Custom menu: Link names
- Post thumbnails Retrieve Url
- Stylesheet is not loading on firefox and IE!
- Inconsistent bloginfo information
- How to custom category template based on category?
- get_the_terms() returning wrong results inside of loop
- Category-specific loop not working
- How to diagnose wp-env environment problem
- When I save changes for css and js in my WP localhost env windows 10 the changes don’t take effects immediately!
- Updatable theme developing
- SIte logo is not displaying
- How to make menus, footer, sidebars multi language
- Unable to delete option
- overlay post title over post’s featured image
- how to add jquery to wordpress
- Hook in parent theme Menu function
- How to add custom nav_menu_css_class to certain menu only?
- Need help with adding custom menu content
- How to avoid Ajax in wordpress theme in making mulitple request?
- Import from HubSpot COS into WordPress 4?
- child comments not displaying as nested
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- Simple loop with shortcode rendering problem
- Theme automatically inserting “more” tag on every post
- How get the 10 most viewed pages (not post)
- WordPress widgets manager option for emulating theme layout
- Conditional tags issue for multiple is_page() conditions in sidebar.php
- Allowed memory size of (…) exhausted
- have_posts() return false on single post
- Twenty sixteen – full height