Support » Themes and Templates » “Blog” page title is reading as the last post title on the page…

  • Hi.
    OK, here’s my issue:
    I have created a page called ‘blog’ and set the ‘posts page’ in settings/reading/ to that page so i get all recent posts to that page. Thing is, the page Title
    <?php the_title(); ?>
    is pulling in the heading of the first post displayed on the page and not the page name ‘my blog’.

    I also use:
    <body ID="<?php echo $post->post_name; ?>
    to make sure the page ID is taken from the page title, this is not working on the ‘blog’ page either.

    I tried a few different templates including default with no change.

    Any ideas?

Viewing 1 replies (of 1 total)
  • When you set WordPress to use a page for posts like you have done once that page is clicked on WordPress will use index.php in your theme as the template which displays things.

    Therefore if you want a title of blog at the top you would need to put this on that template.

    Put this before the loop and it should display:

    <?php if(is_home() ) { ?>
    <?php } ?>

Viewing 1 replies (of 1 total)
  • The topic ‘“Blog” page title is reading as the last post title on the page…’ is closed to new replies.