ThemeShaper Forums » Thematic

[closed]

thematic_close_wrapper : move footer out of #wrapper by code?

(4 posts)
  • Started 3 years ago by wlanni
  • Latest reply from wlanni
  • This topic is resolved
  1. wlanni
    Member

    Hello!

    Rather than hard coding the </div> <!-- #wrapper --> in footer.php, I want to use the thematic_close_wrapper. Apparently I'm still struggling with how to apply_filters, as I've read the documentation, and still don't seem to be getting the result I want.

    On a positive note, I did manage to get the wrapper closing </div> where I wanted it. Here's what I'm working on:

    function close_wrapper_in_thematic_abovefooter() {
    	echo '</div><!-- #wrapper .hfeed -->';
    }
    add_filter('thematic_abovefooter', 'close_wrapper_in_thematic_abovefooter');
    
    function set_close_wrapper_to_false() {
    	echo apply_filters('thematic_close_wrapper', false);
    }
    add_action('thematic_belowfooter','set_close_wrapper_to_false');

    OK, as you can see, I put the apply_filter into that function, as the if statement checking if thematic_close_wrapper is true or false is in the footer.php outside of any hooks or anything, and I can't figure out how else to filter it.

    Posted 3 years ago #
  2. wlanni
    Member

    And within one minute of posting I have a brainstorm and figure out a solution.

    function set_close_wrapper_to_false() {
    	return false;
    }
    add_filter('thematic_close_wrapper','set_close_wrapper_to_false');

    Is this technically correct? Or was there a better way to do this?

    Posted 3 years ago #
  3. that's the right way to target a filter- you pass values to a filter. in this case you are passing 'FALSE'. in your first attempt you weren't returning any value, so nothing was changing.

    Posted 3 years ago #
  4. wlanni
    Member

    Great.

    Thanks Helga!!!!

    Hope this helps other designers/integrators in moving the footer out of the wrapper -- I've done this by hand several times to force a footer to 'stick' to the bottom of a page without using position: absolute.

    Anyway... the end.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.