Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

[Resolved] How to block headers, footers and replace content (4 posts)

Started 3 months, 2 weeks ago by: gary_mazz

  • Profile picture of gary_mazz gary_mazz said 3 months, 2 weeks ago:

    Hi

    I’m fixing the broken group chat. I need to stop the header, footer and replace the content for certain HTTP POSTs. How do I block the headers and footers from being build or replace their contents ?

  • Profile picture of @mercime @mercime said 3 months, 2 weeks ago:

    If that group chat has a template page, use <?php get_header( 'garyheader' ); ?> instead of <?php get_header();?> and at the bottom use <?php get_footer( 'garyfooter'); ?> instead of <?php get_footer(); ?>

    Then create header-garyheader.php and footer-garyfooter.php and add content.

  • Profile picture of gary_mazz gary_mazz said 3 months, 2 weeks ago:

    Awesome suggestion… This will help me out immensely. Unfortunately, the author didn’t create one… I’m revisiting the design. I’m adding persistent logging for meetings.. So I’ll have to add templates

    I also found why I was seeing page headers in the chat data. It part of the fixed processing from WP’s main(). It inits, parse_request, sends header and other stuff. Since the chat plugin wasn’t last… other filters added headers junk after I was done filtering.. For some reason, wp_die() doesn’t stop main() after hooking ‘request’.. or action parse_request’, which is what I was expecting Odd..

    Your suggestion is a much better approach.

    Again thx

  • Profile picture of @mercime @mercime said 3 months, 2 weeks ago:

    Cool. Good luck with the group chat.