[Resolved] Remove Header from Theme

This topic contains 1 reply, has 2 voices, and was last updated by  Andrew Misplon 1 year, 10 months ago.

  • Author
    Posts
  • #4671

    brendan.wright
    Participant

    Hi,

    I am looking for a way to show the content of a page without the header, footer and sidebar to deploy it in an app through a webview.
    I created a new page template (full-width-no-title-no-menu) by copying the existing page template (full-width-no-title) and removing the “get_header();” line. However, the formatting is not great.

    Has anyone done this and is there a simple way?

    Cheers
    Brendan

    #4673

    Andrew Misplon
    Keymaster

    Hi Brendan

    Removing the header is problematic because within the header file is wp_header through which lots of important scripts are outputted. The easiest would be to use CSS in a Custom CSS plugin like Simple Custom CSS or in your child theme style.css file.

    If it’s the home page you’d say something like:

    /* Home */
    .home .site-header,
    .home .site-footer {
    	display:none;
    }
    
    .home #page .site-content {
    	padding-top: 0;
    	padding-bottom: 0;
    }

    (If you’re modifying themes files at a code level, please, be sure to use a child theme).

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Scroll to top