Try this one , ..
$ID = get_the_ID();
$page_data = get_page( $ID );
$excerp = strip_tags($page_data->post_excerpt);
if ( !empty( $excerp ) ) :
the_excerpt();
else :
echo get_permalink()
endif;
Related Posts:
- Limit length of first excerpt in the loop
- How do I pull excerpts from pages?
- Difference between the_permalink() and get_permalink() function
- Use author author display name in permalink structure for pages and posts
- paginate_links() don’t properly work in search.php?
- Refresh page after form action
- Show modified time if post is actually modified
- Check if the user has explicitly set an excerpt
- How to override function in functions.php of parent theme?
- AJAX handler throws 400 (Bad request) – why?
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- When is wp_trim_excerpt() called?
- Convert hyphen to underscore in permalinks
- Stripping shortcode from custom excerpt function
- Most elegant way to enqueue scripts in function.php with foreach loop
- 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
- Adding WooCommerce to a Custom Theme – not working [closed]
- Allow latex in wordpress excerpt
- A snippet after every image
- Function to show only first instance of shortcode
- Custom excerpt legnths for specific pages
- Automatically insert php function into post $the_content
- Adjust which tempalte a page uses with a function?
- Disable shortlinks like ?p=1234 to prevent scraping
- Display WooCommerce subscriptions for user [closed]
- Custom Shortcode, functions PHP WP_Query loop
- Filtering posts by category name based on page’s slug
- How to filter out shortcode when displaying the_excerpt() in the loop?
- 2 Loops, Only Displaying 1 Loop in Both Loops
- Using “Read More” link with custom excerpt
- Custom excerpt function re-factoring
- Manipulate Permalink
- How to display post content instead of excerpt
- Using Schema with `the_excerpt`
- Having a Function Inside of the Loop
- Getting different functions data while using while loop in wordpress
- Custom Post excerpt not working correctly
- Default Custom Field Value Automatically Update
- Multiple Loops Meta Data
- new_excerpt_more link not working properly
- Where to add the permalink in this function?
- paginate_links() don’t properly work in search.php?
- Excerpts are not displayed by a shortcode on category pages
- How to display retweet count and likes in the meta above the excerpt
- Setting a default text for excerpts of a particular category
- How to fix get_the_category function returning incorrect slug?
- The Loop not looping?
- Remove links from the_content when using filters wp_trim_excerpt
- Excerpt for pages not showing
- Test if a post exists by category and date
- The_excerpt() doesn’t parse – how to change that?
- Output loop to function return?
- WordPress Excerpt – How to remove the first link using functions.php
- issue with if/elseif in_array inside foreach loop display only one post
- Strip div From Excerpt
- How to properly refresh page after form action?
- How to change value of variable in theme file with functions.php WordPress?
- Genesis Framework: How to exclude a specific author from archive custom loop
- Problem with calling custom function in a foreach loop
- Using functions.php to include code that’s processed inline
- Adding Read More to Custom excerpts
- Breaking up multiple words and inserting an image after first word
- Limit number of characters in different excerpts
- Simplest Way to Build Custom Archives Page?
- Woocommerce Variable Product Dropdown for Custom Shop Template
- the_date() and the_time() functions display actual date an time instead of published date and time
- How to add extra value to permalink
- How Can I Create a Friendly Slug for a Dynamic Page?
- Add #primary at the end of navlink permalinks on single posts
- How set a while with a function
- Pass post ID from archive template to functions file
- Appending „read more” to the excerpt conditionally
- Prevent function from triggering on current page
- Hide disclaimer from summary excerpts
- Code executes outside of Loop while same code gives ‘Uninitialized string offset’ notice inside a while loop
- Only seems to be displaying one child when there are supposed to be multiple
- How to make an If Else on Excerpt Filter
- getExcerpt: Make ellipsis appear only if character limit is reached
- Integrate WP Tiles into existing loop (index.php) and theme
- need help with ‘… read more’ excerpt in functions.php
- Excerpt length: get 2 paragraphs
- Function to get the name in database table from the comma separated string
- Exclude javascript in certain page url and all following url’s after forward slash
- Can’t change excerpt length and more tag
- More link – not text
- How to add an excerpt and read more link to a page?
- Way of getting queried loop before the query with a filter hook?
- Post variables not displaying correctly in custom function
- Adding a filter to my posts
- Why don’t some template tags work when querying information on single.php?
- Excerpt – First Sentence & Read More
- how to handle multiple forloop?
- Parse error: syntax error, unexpected ‘endforeach’ (T_ENDFOREACH) in [closed]
- How do grab the main loop, with conditions, and output via shortcodes
- Creating mixture of shortcodes to use in the visual/text editor
- Get full slug for a WordPress Post
- function to show youtube videos within excerpt – if condition and apply_filters