WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Make page title = article title? (3 posts)

  1. roppolo
    Member
    Posted 4 years ago #

    I'm using 'Magazine Basic' theme and I'm having a small problem that I feel is hampering my google rankings. When I navigate to an article page, the page title is not changing to the title of the actual article, rather, it stays as my main page title. Is there a simple way to change this so that every page is titled as the title of the article within this page?

    Thanks in advance

  2. Peter Boosten
    Member
    Posted 4 years ago #

    I have this in my header, see if it fits your needs.

    <title>
                            <?php if (is_home()) { echo bloginfo('name');
                            } elseif (is_404()) {
                            echo '404 Not Found';
                            } elseif (is_category()) {
                            echo 'Category:'; wp_title('');
                            } elseif (is_search()) {
                            echo 'Search Results';
                            } elseif ( is_day() || is_month() || is_year() ) {
                            echo 'Archives:'; wp_title('');
                            } else {
                            echo wp_title('');
                            }
                            ?>
                    </title>

    Peter

  3. roppolo
    Member
    Posted 4 years ago #

    Peter, that worked perfectly. Thanks for your help :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags