Community Forums › Forums › StudioPress Themes › Magazine Pro › Remove Header, Menu and Footer from Page
Tagged: Array, footer, genesis_header, header, is_page, landing page
- This topic has 10 replies, 2 voices, and was last updated 1 year, 1 month ago by Brad Dalton.
-
AuthorPosts
-
February 19, 2023 at 3:32 pm #506806JustZParticipant
Does anyone know how to remove the Header and Menu (the entire top bar) and the Footer and Copyright from a page?
We are wanting to create a landing page that uses the normal page template versus https://my.studiopress.com/documentation/magazine-pro-theme/page-templates/landing-page-template/ but are unable to remove the header and footer areas.
February 20, 2023 at 1:44 am #506808Brad DaltonParticipantCode snippets are here https://my.studiopress.com/documentation/snippets/
You can add them to a custom page template or copy and rename the landing page template.
Or try this code https://wpsites.net/genesis-tutorials/remove-header/
February 22, 2023 at 12:10 pm #506820JustZParticipantHi Brad,
Thanks for that info. We don't want to remove the header/navigation/footer for the entire site, just one page. We'd create a custom page template, but the only complete template available in our Theme (Magazine Pro) is the landing page (which we don't like the look of with the black background). We'd ideally like to copy the Default Template, and the code to remove the header/navigation/footer, and then create a custom page template — but we don't see the Default Template available under templated in the Theme Editor.
For the code that calls our to specific page, is that just placed in the stylesheet in the Theme Editor or can you put it in the Additional CSS area?
February 22, 2023 at 12:17 pm #506821JustZParticipantWe tried the code that calls to a specific page in the Additional CSS area, but it didn't change anything for our page (header still appearing). We flushed the cash and opened in a new browser:
add_action('get_header', 'wpsites_remove_header');
/**
* @author Brad Dalton - WP Sites
* @example http://wpsites.net/web-design/remove-header/
*/
function wpsites_remove_header() {
if (is_page('8651') ) {
remove_action( 'genesis_header', 'genesis_do_header' );
}
}February 22, 2023 at 12:25 pm #506822Brad DaltonParticipantPHP code should be pasted at the end of your child themes functions.php file.
February 22, 2023 at 12:41 pm #506823JustZParticipantThanks Brad! That did the trick, much appreciated for the direction!
February 27, 2023 at 12:14 pm #506843JustZParticipantHey Brad,
One more question if you have a moment.
The code below worked great. But we were wanting to add another few pages and no matter how we enter the Page ID (addition page ID 8687) we cannot get it to work for multiple pages at a time. Any thoughts/direction?
// Removes Header Specific Page
add_action('get_header', 'wpsites_remove_header');
function wpsites_remove_header() {
if (is_page('8651')) {
remove_action( 'genesis_header', 'genesis_do_header' );
remove_theme_support( 'genesis-menus' );
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
}
}February 28, 2023 at 8:03 am #506854Brad DaltonParticipantFebruary 28, 2023 at 8:33 am #506855JustZParticipantHi Brad. Thanks again, that did the trick. Your help has been incredible and really helped us accomplish what we wanted!
February 28, 2023 at 8:47 am #506856JustZParticipantThis reply has been marked as private.March 1, 2023 at 5:18 am #506862Brad DaltonParticipantThanks for the positive feedback however i don't have access to private messages.
Here's more about arrays in PHP for the purests.
-
AuthorPosts
- You must be logged in to reply to this topic.