Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #11921
    Dongers
    Member

    I want to create a page with no header and no footer, for displaying some video files on and create a new page template out of it

    I have copied the page-fullwidth.php to page-video.php and have removed the footer section at the bottom and the footer disappears ok, but I cannot work out how to remove the header..?

    any ideas.?

    thanks

    Dongers

    #11935
    Sakin
    Keymaster

    @Dongers: In the same way you can remove header. get_header();

    #11946
    Dongers
    Member

    If I just delete get_header(); from the page template, it resizes the page (smaller, looks like it it turning off the fluid width and resizing the page to the size of the header image) but not actually removing the header…???

    thanks

    Dongers

    #11971
    Sakin
    Keymaster

    @Dongers: I though you wanted to completely remove header and footer. Sorry for that. You have to add conditions in your header.php and footer.php . See this http://codex.wordpress.org/Function_Reference/is_page_template

    #11972
    Dongers
    Member

    Anyone with any further suggestions..?

    TIA

    Dongers

    #11987
    Dongers
    Member

    Sorry didn’t see you next post….!

    So, looking at some posts over at wordpress.com too i found this:

    http://wordpress.org/support/topic/how-to-remove-header-and-footer-from-a-single-page

    Which also about conditionally removing the header and footer based on Page ID by using:

    <?php if( !is_page( ‘1’ ) ) : ?>

    <?php endif; ?>

    but would that go into header.php and footer.php or the page-video.php (<my new page template) or somewhere else..?

    #11992
    Dongers
    Member

    OK just put this together in Full Width Disable Sidebar Template Page Template (page-fullwidth.php)

    <?php if( !is_page('150') ) :?>

    <?php
    /**
    * Template Name: Full Width Disable Sidebar Template
    * Description: A Page Template that disables a sidebar to pages
    *
    * @package Catch Themes
    * @subpackage Catch_Box
    * @since Catch Box 1.0
    */

    get_header(); ?>

    <?php endif;?>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( 'content', 'page' ); ?>

    <?php comments_template( '', true ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>

    <?php
    /**
    * catchbox_after_content hook
    *
    */
    do_action( 'catchbox_after_content' ); ?>

    </div><!– #primary –>

    <?php
    /**
    * catchbox_after_primary hook
    *
    */
    do_action( 'catchbox_after_primary' ); ?>

    <?php if( !is_page('150') ) :?>

    <?php get_footer(); ?>

    <?php endif;?>`

    but doesnt seem to have done anything..? is this the right place for this…?

    *EDIT* The code isnt posting correctly should be the following

    <?php if( !is_page( ‘1’ ) ) : ?>

    thanks

    Dongers

    #11994
    Dongers
    Member

    OK cracked it…Using Firebug, I identified the correct elements to hide in header.php and footer.php.

    I then used the following around those elements

    <?php if( !is_page( ’1′ ) ) : ?>

    and

    <?php endif; ?>

    Problem was that I was identifying the page by the ‘Page Ordering Number’ not the actual Page ID! D’oh!!!

    Once I changed it the page id to the page slug it started working. I then installed WP-SHOW IDs plugin to show the proper Page IDs, updated header and footer php’s with the RIGHT Page ID and now it its working as expected!

    Thanks

    Dongers

    #11997
    Sakin
    Keymaster

    @Dongers: Nice. Great Work.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Remove header/footer from single Page’ is closed to new replies.