• add_filter(‘the_content’,’filter_cp’);

    function filter_cp($content) {

    die($content);

    return $content;
    }

    As I know, the script should throw off the value of the $content when I open a post on frontpage.However, nothing happened, the post was opened normally.Does I make some mistake somewhere?

    Thanks in advanced
    hywl51

Viewing 2 replies - 1 through 2 (of 2 total)
  • That needs to be in an activated plugin file. The filter works fine–it’s just that WP isn’t running the code.

    You can also make use of filters (and functions, of course) in a functions.php document added to your theme. If this file exists with the active theme, WordPress will include it automatically.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘the_content filter hook does not work’ is closed to new replies.