Global $post
variable is filled on by running post through the loop (the_post()
method or function, setup_postdata()
function). If you look at the source for Walker_Page
it is not running a loop and so does not make posts’ data available through $post
.
Since excerpt_more
is not provided with info on the post either, you would need to track post data on your own and access it inside your filter function.
Related Posts:
- need help with ‘… read more’ excerpt in functions.php
- Can’t change excerpt length and more tag
- How to add an excerpt and read more link to a page?
- Shortcode producing headers already sent error
- Check if the user has explicitly set an excerpt
- How to override function in functions.php of parent theme?
- Show Video in Excerpt
- When is wp_trim_excerpt() called?
- Stripping shortcode from custom excerpt function
- Change ul class=”children” for wp_list_pages?
- Remove images from get_the_excerpt
- Custom page template how to check is_page from functions.php?
- display public excerpt for private post
- get_the_excerpt() not returning anything when post has no excerpt
- get excerpt without images
- Allow latex in wordpress excerpt
- Custom excerpt legnths for specific pages
- Manipulate Output of wp_list_something: select menu instead of li’s
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Using “Read More” link with custom excerpt
- List child pages of specific page using shortcode
- How to get specified parent page title in my function
- How to display post content instead of excerpt
- Using Schema with `the_excerpt`
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- How to put “Read more” link in Custom Excerpt inside p tag?
- Custom Post excerpt not working correctly
- Limit length of first excerpt in the loop
- 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
- Remove links from the_content when using filters wp_trim_excerpt
- Excerpt for pages not showing
- How do I pull excerpts from pages?
- WordPress Excerpt – How to remove the first link using functions.php
- Strip div From Excerpt
- How to change value of variable in theme file with functions.php WordPress?
- More tag locked in Hemingway
- first paragraph of the_content as meta description
- Using depth=n in wp_list_pages
- Sort and display pages with specific custom field (not tag)
- Adding Read More to Custom excerpts
- Limit number of characters in different excerpts
- How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?
- the_excerpt function not showing image
- Why does modifying the “read more” link remove the link class?
- Appending „read more” to the excerpt conditionally
- how can I change the read more link destinations and direct all to the same page?
- Hide disclaimer from summary excerpts
- How to make an If Else on Excerpt Filter
- getExcerpt: Make ellipsis appear only if character limit is reached
- Excerpt length: get 2 paragraphs
- Check if excerpt is empty at loop-portfolio
- wp_list_pages change of children and anchor of parent
- More link – not text
- Adding a filter to my posts
- Excerpt – First Sentence & Read More
- function to show youtube videos within excerpt – if condition and apply_filters
- Solution to render Shortcodes in Admin Editor
- Define page template in wp_insert_post
- Sort posts by Date (DESC) and by Title (ASC)
- Remove a menu item created by a plugin
- Child theme functions.php do I use php open and close tags?
- Modify Admin Bar Link
- Using wp_get_nav_menu_items() to list children of children pages
- WP 4.4. responsive loads normal image after loading the responsive image
- Load post with a different template?
- Custom menus displaying all pages instead of set pages
- How Can I Access a PHP Variable in Another PHP Function
- How to fix a theme with page.php Default Template that accidentally deleted?
- Theme Demo in live Site
- Two different menus for two different locations?
- Change a sidebar name?
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- Different ‘read more’ links
- How to use max and min values of custom fields
- How to use Internationalized human_time_diff() function in Chinese?
- Empty Date Returned on my function
- Woocommerce Attributes pulling in wrong data
- How to get the post_name when in preview?
- How can I change a function in a parent theme via a child themes functions.php
- Execute a ultimate member action when user role is updated
- How can I make a widget shortcode to control all the widgets?
- admin-ajax.php + load-scripts.php hanging for minutes
- Unique sequential reservation code
- Creating new blog on multisite programatically without hacks?
- Allowing users to view private posts (pending approval)
- Add button to kitchen sink toggle
- Get User Login Data (date, time… )
- comments_popup_link without echo?
- Can’t filter wp_get_attachment_link
- Impossible to call wordpress function inside an include?
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Modify post filter to set custom number of posts per page and exclude child posts
- is there a way to remove featured image from blog page and single page
- Include the post type before the title of search results
- How can i unload effect.min.js file?
- Adding additional roles on registration
- Native gallery custom html output
- Auto scroll to id on page load on all pages except home page. Only do this on mobile