0
votes
1answer
293 views

How to get the post excerpt using post object?

I'm trying to show post excerpt as in navigation. I'm trying this in plugin, does it make any sense? i don't know. I used $nex_obj = get_adjacent_post(false, '', true); for next post and it returns ...
0
votes
1answer
101 views

the_excerpt() does not work with has_excerpt()?

I'm trying to shorten the excerpt but it does not work. It shows the full excerpt which I write in the post edit! I've added this to the functions.php function custom_excerpt_length( $length ) { ...
0
votes
1answer
86 views

Add Filter - Pass Variable (PHP < 5.3)

When using Anonymous Functions in PHP < 5.3 I get this error: Parse error: syntax error, unexpected T_FUNCTION This is especially troublesome for add_filters. For instance, if I want to make a ...
0
votes
0answers
40 views

get_the_excerpt on mobile still displays continue reading

I'm writing a plugin where I'm using the excerpt field as just another field. In order to get rid of the 'Continue Reading' Link, I'm removing all possible theme filters: add_action( ...
0
votes
1answer
151 views

Can't change excerpt length and more tag

I tried to change the excerpt length and the more tag the way it is described in the codex: function custom_excerpt_length( $length ) { return 10; } add_filter( 'excerpt_length', ...
0
votes
1answer
423 views

get_the_excerpt() with fallback like the_excerpt()

You know when using the_excerpt() and no "excerpt" is set on a post it automatically uses the first 50 words or so. Is the same also possible when using get_the_excerpt() For instance I'm using ...
0
votes
1answer
1k views

add_filter on “the_excerpt” only works when post does not have excerpt

class my_menu extends WP_Widget { function widget($args, $instance) { // Excerpt length filter $new_excerpt_length = create_function('$length', "return " . $excerpt_length . ";"); if ( ...
1
vote
1answer
103 views

Give “Read More” precedence over excerpt() word count

By default, the_excerpt() displays the content before the <!--more-->, trimming it at ~50 words. Is there any way to prevent this trimming functionality when the <!--more--> is present, ...
2
votes
1answer
513 views

Add $more_link_text parameter to the_excerpt()

this filter is on the Wordpress Codex …  add_filter('excerpt_more', 'new_excerpt_more'); function new_excerpt_more($more) { global $post; return '<a class="moretag" href="'. ...
7
votes
3answers
6k views

apply_filters() and the_excerpt are giving unexpected results

I feel like I must be missing something pretty obvious, here, but I can't seem to get WordPress to cooperate. I'm generating Facebook OG tags with a function. Everything works fine, except for the ...
3
votes
1answer
3k views

How to use the_excerpt in a filter hook?

I was hoping to process the_excerpt just like one would with the_content, but no such luck. How can I pass the excerpts of a Posts Page, through my plugin? I've tried variations on this: ...