• Hello Friends,
    I am new to WP and I am badly stuck with Post Title and Page Title.

    I made my own custom theme where I am displaying “Page Title” using some graphics.

    <div class=”content” role=”main”>
    <div class=”pagename”><h1 class=”entry-title”><span><?php the_title(); ?></span></h1></div>
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <h2 class=”post-title”><span><?php the_title(); ?></span></h2>
    <div class=”entry-content”> ………

    PROBLEM

    1. All the pages are displaying Title twice because the_title(); is also mentioned in Post.
    2. The Blog page “BLOG” when opened the page title is been replaced by the recent post title. I want the page title to display.

    I tried using wp_title in H1 it solves the problem but then the default static page displays nothing at Page Title. Please help me solve this problem, i worked really hard to built this theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You need to put your titles inside the loop on the template. Therefore you need to replace:

    <h2 class="post-title"><span><?php the_title(); ?></span></h2>

    with whatever you want to use as your title – I guess something like this:

    <div class="pagename"><h1 class="entry-title"><span><?php the_title(); ?></span></h1></div>

    Thread Starter czone

    (@czone)

    My posts are in a loop and that part is working fine i.e. whenever I add a new post it appears with its title.

    Here are 2 images to explain my problem

    Issue with Blog Page = http://www.mentorarts.com/images/blog.gif
    Issue with Pages = http://www.mentorarts.com/images/page.gif

    Did you ever solve this one?

    The Blog page “BLOG” when opened the page title is been replaced by the recent post title. I want the page title to display.

    I’m having that problem too.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Seperating Post Title and Page Title’ is closed to new replies.