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
- Missing feature image link function
- What’s the difference between home_url() and site_url()
- Remove “Category:”, “Tag:”, “Author:” from the_archive_title
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- remove empty paragraphs from the_content?
- What is the “with_front” rewrite key?
- Why use if function_exists?
- How to override parent functions in child themes?
- wp_enqueue_script was called incorrectly
- Add multiple custom fields to the general settings page
- Ajax call always returns 0
- 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
- How long does a deprecated function live in core?
- Solution to render Shortcodes in Admin Editor
- How to add a data attribute to a WordPress menu item
- What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
- remove_action on after_setup_theme not working from child theme
- plugins_url vs plugin_dir_url
- Remove type attribute from script and style tags added by WordPress
- How to run a function every 5 minutes?
- Best way of passing PHP variable between partials?
- Upload Multiple Files With media_handle_upload
- How to display custom field in woocommerce orders in admin panel?
- How to end the excerpt with a sentence rather than a word?
- Adding fields to the “Add New User” screen in the dashboard
- Issues with title-tag and document_title_parts
- How do I get the current edit page ID in the admin?
- How to check if a user exists by a given id
- Why isn’t is_page working when I put it in the functions.php file?
- Add tags to the section via functions.php
- Add image size if page template
- How to create a custom order status in woocommerce!
- Remove Actions/Filters added via Anonymous Functions
- Adding a second email address to a completed order in WooCommerce [closed]
- How to load parent_theme functions.php before child_theme?
- How to load scripts/styles specific for a page
- Programatically add options to “add new” custom field dropdown
- Is there any global functions.php file which works for any theme?
- Excluding iPad from wp_is_mobile
- When should you, and when should you not, use wp_list_pluck()?
- Get the ID of the page a menu item links to?