WordPress.org

Ready to get started?Download WordPress

Forums

Posts page title (2 posts)

  1. chocula
    Member
    Posted 1 year ago #

    Ok so i have tried and tried, searched and found multiple threads on this but none of them seem to work.

    All i want to do is have a title (as other pages do) on my posts page (as setup in the admin reading options) and to continue having a title (called news) when you click to view a post. Don't understand why this is so hard but still it seems to be impossible.

    I also don't understand why the navigation doesn't remain highlighted when you click to view a post - and is there anyway to make it so?

    My theme is based on the default twentyeleven theme. If anyone can help i will be really really happy!

    Thank you

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the posts page is done by index.php and has therefore no page title;

    you can retrieve the page title, if you have set a 'page for posts', with this code:

    <?php if( is_home() && get_option('page_for_posts') )
    echo '<h1 class="entry-title">'.get_the_title(get_option('page_for_posts')).'</h1>';

    possibly add this into index.php before the loop.

Topic Closed

This topic has been closed to new replies.

About this Topic