Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created August 30, 2018 09:24
Show Gist options
  • Select an option

  • Save andrewlimaza/b5f096692f5377b793db2e671564f4b9 to your computer and use it in GitHub Desktop.

Select an option

Save andrewlimaza/b5f096692f5377b793db2e671564f4b9 to your computer and use it in GitHub Desktop.

Revisions

  1. andrewlimaza created this gist Aug 30, 2018.
    26 changes: 26 additions & 0 deletions hide-logo-and-footer-on-wp-pages.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    <?php
    /**
    * This will hide a site's logo and entire footer from specific pages.
    * Add this code to your child theme's functions.php or custom plugin.
    * Adjust the $pages_to_hide array with page slugs that you would like to hide the footer and site logo on.
    */

    function memberlite_hide_logo_and_footer_on_some_pages() {

    // Use page slugs in a comma separated list.
    $pages_to_hide = array(
    'page-slug-1',
    'page-slug-2',
    'page-slug-3',
    );

    if ( is_page( $pages_to_hide ) ) {
    ?>
    <style type="text/css">
    .site-branding { display:none; }
    footer{ display:none; }
    </style>
    <?php
    }
    }
    add_action( 'wp_head', 'memberlite_hide_logo_and_footer_on_some_pages' );