Yoast SEO
[resolved] [Plugin: WordPress SEO by Yoast] Titles from query, not page title (2 posts)

  1. Creative Slice
    Posted 5 years ago #

    This plugin works great for 99% of my pages. However on page which I'm doing a custom get_posts call (in additional to the regular loop) WordPress SEO is using the last post in the query page title instead of the actual page title. For example I have a Site Map page but instead of showing "Site Map" for the title it's showing the title for the very first post in my blog.

    The code I have on my page below the regular loop is:

    $myposts = get_posts('numberposts=20');
    foreach($myposts as $post) : ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>

    Perhaps I need to manually reset the loop at the bottom of my template file?

  2. Creative Slice
    Posted 5 years ago #

    This bug was with the "Force rewrite titles" feature. When that box was checked AND my template title was set to wp_title('') this problem occurred.

    I simply unchecked the box and it's fixed.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic