Opened 15 years ago
Closed 10 years ago
#11048 closed enhancement (wontfix)
Add new is_excerpt conditional tag
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | close |
Focuses: | Cc: |
Description
Hi,
I'd like request adding new conditional tag - is_excerpt(). It can be very useful to add some stuff to the posts on frontpage that were splitted using <!--more--> tag.
Change History (6)
#3
@
15 years ago
Next to what scribu is saying (which I must confirm as well), this does not make much sense logically. A themer should be able to find out wich actual template/query is using excerpts or not. So this can be decided by the theme or based on the query itself. There is no general rule.
#4
@
11 years ago
- Component changed from General to Plugins
- Resolution invalid deleted
- Status changed from closed to reopened
Without referring to the wordpress definition of an excerpt, if a plugin callback function (e.g. shortcode callback) can determine from which context it is being called, then the callback function can do a better customisation.
For example, when a "trimmed version" of a post is called, shortcode callback can skip all translation and return empty string. But when the full post is shown, the callback will normally parse and return the content. Currently, conditional tags such as if(!is_single()) can be used as a workaround.
This should work in places such as the_content() and the_excerpt().
#5
@
11 years ago
- Component changed from Plugins to Posts, Post Types
- Keywords close added; new is_excerpt conditional tag removed
- Milestone set to Awaiting Review
Replying to jakesee:
For example, when a "trimmed version" of a post is called, shortcode callback can skip all translation and return empty string.
Note that wp_trim_excerpt() normally strips all shortcodes.
is_excerpt() wouldn't work because it's on a per-post basis, whereas the rest of the conditional tags are related to the current query.
Please use the Ideas forum.