- This topic has 16 replies, 4 contibutors, and was last updated 9 years, 1 months ago by .
-
Question
Answers
- The question ‘Hide header completely’ is closed to new replies.
BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Hide header completely
Tagged: hide header
Hi
I want to create a login page without a header or footer. Hiding the footer is easy, but obviously as the header is part of admin I can’t.
Is this possible?
Many thanks.
Hi @keen, header.php contain most of js and css
WordPress enqueue js and css at footer and header both.
you can trim it down inside the custom page template
Regards
Varun Dubey
Hi Varun,
Can you go into a bit more detail for me?
Many thanks.
Hi @keen,
You can remove those division which you do not have to use at your login page to get minimized header code
Like
Line 34 to Line 346
and copy remain part to your page template at top instead of call get_header()
It will include all js and css without including header
wp_head() is the main function which enqueue all the js and css
Regards
Varun Dubey
OK, I think I’ve understood you. I’ll give it a go! Thanks.
🙂
Hi Varun,
I’ve removed those lines of code and tried using an alternative header call and directly copying and pasting into the template file.
I’ve created a new template and selected that for my register page, but the page is still using the boss/page.php template and not the one in my child theme.
Should I have just removed lines 34-346 or something else? Could removing those lines prevent the selected template from being used?
Many thanks
Hi @keen, You can simply remove those line of codes form page template file
and header will be minified only on those pages on which this specific page template will be selected.
Regards
Hi,
Sorry I missed this response. I’m pretty sure that’s what I did and it didn’t work. Can you confirm that I should be removing exactly and only from lines 34-346?
Thanks.
Hi @keen
It is more simplified now with modular header.php
you just need to remove
<header id="masthead" class="site-header" data-infinite="<?php echo ( boss_get_option( 'boss_activity_infinite' ) ) ? 'on' : 'off'; ?>">
<div class="header-wrap">
<div class="header-outher">
<div class="header-inner">
<?php get_template_part( 'template-parts/header-fluid-layout-column' ); ?>
<?php get_template_part( 'template-parts/header-middle-column' ); ?>
<?php get_template_part( 'template-parts/header-profile' ); ?>
</div><!-- .header-inner -->
</div><!-- .header-wrap -->
</div><!-- .header-outher -->
<div id="mastlogo">
<?php get_template_part( 'template-parts/header-logo' ); ?>
<p class="site-description"><?php bloginfo( 'description' ); ?></p>
</div><!-- .mastlogo -->
</header><!-- #masthead -->
Regards
Varun Dubey
the header.php is being included regardless of calling it in a blank page template.
I created a file called “joeysturgis.php” and put this in it:
<?php /*
Template Name: Joey Sturgis
*/
?>nothing
Then I uploaded this file to the sociallearner folder next to files like “single.php” and “header.php”
Then I went to my Sample Page and changed the Page Template to Joey Sturgis
Then I hit update and refresh my page, and the title bar and search bar is still there. I go to the inspector and check the source code and inside the body classes I see that “page-template-joeysturgis” is being used.
Hi @unstoppablerecordingmachine, Try this code it will give you a page without header, footer sidebar.
<?php
/**
* Template Name: Custom Template
*/
?>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="msapplication-tap-highlight" content="no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/images/favicon.ico" type="image/x-icon">
<!-- BuddyPress and bbPress Stylesheets are called in wp_head, if plugins are activated -->
<?php wp_head(); ?>
</head>
<body>
<div id="scroll-to"></div>
<div id="panels" class="<?php echo (boss_get_option( 'boss_adminbar' )) ? 'with-adminbar' : ''; ?>">
<div id="main-wrap"> <!-- Wrap for Mobile content -->
<div id="inner-wrap"> <!-- Inner Wrap for Mobile content -->
<div id="page" class="hfeed site">
<div id="main" class="wrapper">
<div class="page-full-width">
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
</div><!-- .page-full-width -->
</div><!-- #main .wrapper -->
</div><!-- #page -->
</div> <!-- #inner-wrap -->
</div><!-- #main-wrap (Wrap For Mobile) -->
</div><!-- #panels -->
</body>
</html>
Regards
I just tried that, and it doesn’t work. I don’t understand why. It just loads the page like normal. It seems like page templates are completely ignored or something. Unless I use a built in one, yet the custom one is in the list.
I’m trying to do this for the Home Page. When I use the page template for a normal page, it works. When I tried to put it on the Sample Page marked as the Front Page, it doesn’t work.
Hi @unstoppablerecordingmachine, Please remove <?php wp_head(); ?>
from above code and try again.
Regards