• I have a site in development locally, I have created a page /blog and assigned my posts to that page through the settings. Each of my pages has a H1 tag that shows the page heading. On the blog page instead of giving me my page title is attributes it to the latest title of my most recent blog post.

    I cannot post a link as the site is running local, but here is my header code:
    <h1 class="page-title"><?php the_title(); ?></h1>

    Not sure why it is doing this, I have searched the forums and the web and cannot find an answer. Please help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Can you share your blog page code which is written just before title display code?

    Thread Starter goredshift

    (@goredshift)

    The code above is being called from my header.php file. I am not sure the code you are looking for is in this file. I am attaching the header code from content.php

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<header class="entry-header">
    			<?php if ( is_sticky() ) : ?>
    				<hgroup>
    					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    					<h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
    				</hgroup>
    			<?php else : ?>
    			<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    			<?php endif; ?>
    
    			<?php if ( 'post' == get_post_type() ) : ?>
    			<div class="entry-meta">
    				<?php twentyeleven_posted_on(); ?>
    			</div><!-- .entry-meta -->
    			<?php endif; ?>
    
    			<?php if ( comments_open() && ! post_password_required() ) : ?>
    			<div class="comments-link">
    				<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
    			</div>
    			<?php endif; ?>
    		</header><!-- .entry-header -->

    Is this what you are looking for? Thanks for looking at it.

    The shared code is just fine and used for listing posts.

    Can you share two or three lines of code from above and below where you are displaying your page title (header).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page Title same as most recent blog post title’ is closed to new replies.