So far, I've been able to only consistently hook the_content, appending my plugin at the end. How can I test if the displayed article is not the_content, but an excerpt, and hook my plugin after every the_excerpt?


From the codex there are a couple of possible filters for you to try:

Personally I would try the first one with something like:

function fileterExcerpt($excerpt){
        $excerpt .= "Some extra text";
    return $excerpt;
add_filter( 'get_the_excerpt', 'filterExcerpt' );

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.