[wp-hackers] filter the_content without affecting the_excerpt
Braydon
ronin at braydon.com
Tue Jul 19 21:17:36 UTC 2011
I got around this by doing this by doing this and run it on both the
"the_content" and "the_excerpt" filter without it appearing twice.
function my_content_filter($content) {
global $post;
if ( !is_feed() && (is_singular() || is_author() || is_category()
|| is_front_page() ) ) {
// do stuff to $content
return $content;
} else {
return $content;
}
}
On 07/19/2011 12:38 PM, Philip Walton wrote:
> In my theme I'm adding a filter to "the_content" to insert social
> sharing buttons at the beginning of each post, but then when I call
> the_excert() the text of those buttons is showing up.
>
> I know I can just write another filter on "get_the_excerpt" to remove
> them, but that just seems wrong.
>
> Is there a way to filter the_content without affecting the_excerpt?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> !DSPAM:4e25dd20226312031179017!
>
More information about the wp-hackers
mailing list