Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author Tom

    (@edge22)

    Can you paste the contents of your page template into a pastebin and post the link here? https://pastebin.com/

    Thanks,
    Tom

    Theme Author Tom

    (@edge22)

    Were you able to resolve this?

    Thread Starter redthruviolet

    (@redthruviolet)

    Here is the code for the file, page_no_header.php:

    <?php

    /*
    Template Name: Page with No Header

    Stolen from Generate Press’s index.php and header.php

    Susan Sailow

    18Aug2014

    */

    ?>

    <!– From header.php –>

    <!DOCTYPE html>

    <html <?php language_attributes(); ?>>

    <head>

    <meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
    <meta name=”viewport” content=”width=device-width, initial-scale=1″>

    <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title>

    <link rel=”profile” href=”https://gmpg.org/xfn/11″&gt;
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>”>

    <?php wp_head(); ?>

    </head>

    <body itemtype=”https://schema.org/WebPage&#8221; itemscope=”itemscope” <?php body_class(); ?>>

    <?php do_action( ‘generate_before_header’ ); ?>

    <!– Susan Sailow, 15Aug2014: Add call to breadcrumb functions –>

    <div class=”grid-container grid-parent”>
    <?php the_breadcrumb(); ?>
    </div>

    <div id=”page” class=”hfeed site grid-container container grid-parent”>
    <div id=”content” class=”site-content”>

    <!– From index.php –>

    <div id=”primary” <?php generate_content_class();?>>
    <main id=”main” <?php generate_main_class(); ?> itemtype=”https://schema.org/Blog&#8221; itemscope=”itemscope” itemprop=”mainContentOfPage” role=”main”>
    <?php do_action(‘generate_before_main_content’); ?>
    <?php if ( have_posts() ) : ?>

    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php
    /* Include the Post-Format-specific template for the content.
    * If you want to override this in a child theme, then include a file
    * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    */
    get_template_part( ‘content’, get_post_format() );
    ?>

    <?php endwhile; ?>

    <?php generate_content_nav( ‘nav-below’ ); ?>

    <?php else : ?>

    <?php get_template_part( ‘no-results’, ‘index’ ); ?>

    <?php endif; ?>
    <?php do_action(‘generate_after_main_content’); ?>
    </main><!– #main –>
    </div><!– #primary –>

    <?php

    do_action(‘generate_sidebars’);

    get_footer();

    Theme Author Tom

    (@edge22)

    Try taking the code from page.php instead of index.php – it looks like you took it from index.php which looks for blog posts, which would explain why no content is showing up.

    Theme Author Tom

    (@edge22)

    Were you able to figure it out?

    Thread Starter redthruviolet

    (@redthruviolet)

    Yes, thank you again!

    Here is the code:

    <?php

    /*
    Template Name: Page with No Header

    Stolen from Generate Press’s page.php and header.php

    Susan Sailow

    18Aug2014

    */

    ?>

    <!– From header.php –>

    <!DOCTYPE html>

    <html <?php language_attributes(); ?>>

    <head>

    <meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
    <meta name=”viewport” content=”width=device-width, initial-scale=1″>

    <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title>

    <link rel=”profile” href=”https://gmpg.org/xfn/11″&gt;
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>”>

    <?php wp_head(); ?>

    </head>

    <body itemtype=”https://schema.org/WebPage&#8221; itemscope=”itemscope” <?php body_class(); ?>>

    <?php do_action( ‘generate_before_header’ ); ?>

    <div id=”page” class=”hfeed site grid-container container grid-parent”>
    <div id=”content” class=”site-content”>

    <!– From page.php –>

    <div id=”primary” <?php generate_content_class();?>>

    <main id=”main” <?php generate_main_class(); ?> itemprop=”mainContentOfPage” role=”main”>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>

    <?php
    // If comments are open or we have at least one comment, load up the comment template
    if ( comments_open() || ‘0’ != get_comments_number() )
    comments_template();
    ?>

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

    </main><!– #main –>

    </div><!– #primary –>

    <?php

    do_action(‘generate_sidebars’);

    get_footer();

    Theme Author Tom

    (@edge22)

    You’re very welcome ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Content Missing in New Page Template’ is closed to new replies.