• On my posts page (page.php)

    I want to display the name of the page

    not the title of the first post…

    `<h1><?php the_title(); ?></h1>
    <?php $page_description = get_post_meta($post->ID, “_ttrust_page_description”, true); ?>
    <?php if ($page_description) : ?>
    <p><?php echo $page_description; ?></p>
    <?php endif; ?> `

    so a value like <h1><?php page_title(); ?></h1> ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    the_title() should display the name of the page. Are you trying to display posts inside the page or something?

    On my posts page (page.php)

    the posts page is usually done via index.php or home.php

    review https://codex.wordpress.org/Creating_a_Static_Front_Page

    ? related: https://wordpress.org/support/topic/twentythirteen-all-page-titles-show-but-not-blog-page-title?replies=3

    Thread Starter wiziwiz

    (@wiziwiz)

    Yes the posts page is usually on home.php and Index,php – however I am using the Static Home Page option – I followed the guidelines to the letter in the codex.

    re the answer on that your post may need to be updated as adding the suggested code caused my site to crash,

    however I am using the Static Home Page option

    yes, and in case you have set a ‘posts page’, then this page will be done via index.php or home.php – therefore editing page.php won’t do anything for the ‘posts page’.

    what codes exactly have you tried to insert into what files?

    are you changing to php and back to html accordingly and correctly?

    please post he full codes of those edited files.

    Thread Starter wiziwiz

    (@wiziwiz)

    ok thanks for the swift reply,

    I have found the issue in the index.php file

    <h1><?php echo $blog_page->post_title; ?></h1>

    so clearly this is going to show the post title , it is showing the title of the first article in the posts page which I have called “articles”

    so I have just hard coded to get around it till better option

    <?php $blog_page = get_page($blog_page_id); ?>
    	<h1>Articles</h1>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘page title not the_title’ is closed to new replies.