Forums

[resolved] Page template isn't showing page heading (2 posts)

  1. Ellen Finkelstein
    Member
    Posted 1 year ago #

    I started using a custom page template for the 1st time, and the one I found does everything I want (just show the content) but it doesn't show the page's heading. It just starts with the main content. Here's the code I'm using (I don't know PHP, but know how to add it to the page if someone tells me what to add.)

    <?php
    /**
    Template Name: OneColumn
     */
    get_header(); ?>
    <div class="content">
    		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    			<div id="post-<?php the_ID(); ?>" class="post">
    				<?php the_title( '<h1 class="page-title entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h1>', false ); ?>
    				<div class="entry-content">
    					<?php the_content(); ?>
    					<?php wp_link_pages( array( 'before' => '<p class="pages">' . __('Pages:', 'example'), 'after' => '</p>' ) ); ?>
    				</div>
    			</div>
    			<?php endwhile; ?>
    		<?php else: ?>
    			<p class="no-data"><?php _e('Sorry, no page matched your criteria.', 'example'); ?></p>
    		<?php endif; ?>
    	</div>
    <?php get_footer(); ?>

    Thanks in advance for your help.

  2. Ellen Finkelstein
    Member
    Posted 1 year ago #

    Figured it out! I changed "false" to "true" in the line about the_title.

Topic Closed

This topic has been closed to new replies.

About this Topic