can’t get apply_filter to work in wordpress thematic

I am learninig to create templates in wordpress using the thematic framework

In the header file I find:

Read More
 // Filter provided for altering output of the header opening element
    echo ( apply_filters( 'thematic_open_header',  '<div id="header">' ) );

   // Action hook creating the theme header
   thematic_header();

    echo ( apply_filters( 'thematic_close_header', '</div><!-- #header-->' ) );

I want to add a wrapper div element around the div id=”header”…/div created above

I have tried to edit the apply_filter lines like this:

echo ( apply_filters( 'thematic_open_header',  '<div id="headerWrapper"><div id="header">' ) );

but it doesn’t work, just printout out div id=”header”

How can I get it to create the html that I want it to?

Thanks

Related posts

Leave a Reply

1 comment

  1. Filters are used in functions.php or in a plugin like this:

    add_filter( 'thematic_open_header', function(){
        return '<div id="headerWrapper"><div id="header">';
    });
    

    The basic difference between apply_filters and do_action is that the first filters some value and returns something, while add_action will be used to do anything you want with the parameters sent or output something to the browser.

    Some articles of interest: [1], [2], [3] and [4].