• I’m using a twentythirteen child theme. I’ve created a custom theme to produce a fairly simple front page. I don’t want any navigation beyond a button to ‘continue’ to latest posts.

    The custom template is registering in the ‘new page’ drop down but despite calling a modified header, I can’t get it to shake off the standard header
    Template code

    <?php
    /*
    Template Name: Cover Page
    */
    ?>
    
    <?php get_header(‘custom’); ?>
    Here's my cover page!
    <?php get_footer(); ?>

    header-custom.php (effectively the standard twentythirteen header with the navigation deleted) + saved in the child theme

    * @since Twenty Thirteen 1.0
     */
    ?><!DOCTYPE html>
    <!--[if IE 7]>
    <html class="ie ie7" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if IE 8]>
    <html class="ie ie8" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if !(IE 7) | !(IE 8)  ]><!-->
    <html <?php language_attributes(); ?>>
    <!--<![endif]-->
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<meta name="viewport" content="width=device-width">
    	<title><?php wp_title( '|', true, 'right' ); ?></title>
    	<link rel="profile" href="https://gmpg.org/xfn/11">
    	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    	<!--[if lt IE 9]>
    	<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
    	<![endif]-->
    	<?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
    	<div id="page" class="hfeed site">

    I’m clearly doing something wrong – I’ve followed so many other forum threads to get to this place I think I’ve lost track but essentially it’s still calling the standard twentythirteen header. Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The single quotes in your get_header() function look funky.

    <?php get_header(‘custom’); ?>

    Copy this instead.

    <?php get_header('custom'); ?>

    That might do the trick.

    In the single.php file try replacing the get_header(); with this.

    if(is_front_page() ){
    get_header(‘custom’);

    }else{
    get_header();

    }

    Thread Starter MikeCordingley

    (@mikecordingley)

    Many many thanks – you spotted it first time with funky quotes that I hadn’t spotted. I’ve tried so many variations but the one consistent was the quotes I’d copied and pasted.

    Homer says ‘Doh….

    It happens! Text editor syntax highlighters will catch those kinds of little inconsistencies for you. I’m glad that resolved the issue!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom template to suppress navigation’ is closed to new replies.