I am also experiencing issues with the title tags not displaying correctly. I reached out to AIOSEO support and was advised it was a theme issue and nothing to do with the plugin. I have since seen the same problem on dozens of websites that are all using different themes. Absolute disgrace to what has been an amazing plugin for a very long time.
No its not the theme issue, I reinstalled the old version and working fine. when I go to the new version then I lost the titles
Most probably you have WP query loop without wp_reset_postdata somewhere in the theme, and that causes different post title appear.
Hey @lahorimela,
What happens when you switch to the default TwentyTwenty theme?
– Arnaud
@soundstrategies but it was working before and there is no wp_reset_postdata in my template.
@arnaudbroes when I switch to default it’s working fine. I don’t understand what I am missing.
This is what I am using to query the posts.
<?php
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$args = get_post_meta($post->ID, 'job_tag', true);
$wp_query->query('tag='.$args.'&posts_per_page=12&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
-
This reply was modified 5 years, 5 months ago by
Xaib Aslam.
-
This reply was modified 5 years, 5 months ago by
Xaib Aslam.
Hi Xaibi,
plugin logic changed, and it become critical to follow standards of WP_Query usage: https://developer.ww.wp.xz.cn/reference/classes/wp_query/ – please refer examples and wp_reset_postdata usage. So you might need to review your theme code to put wp_reset_postdata where it is needed and is missed.
@soundstrategies thanks for the information but I am not a dev, I do search and then do experiments, so I have no idea what to do now. If you have some time can you share the code? This is the loop I am using…
<?php $count = 1; ?>
<?php
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$args = get_post_meta($post->ID, 'job_tag', true);
$wp_query->query('tag='.$args.'&posts_per_page=12&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<?php get_template_part('includes/job-loop'); ?>
<?php if ($count == 6) : ?>
(MY AD CODE)
<?php endif; $count++; ?>
<?php endwhile; ?>
-
This reply was modified 5 years, 5 months ago by
Xaib Aslam.
as I can see “og:title” and “twitter:title” meta fields are set correctly, so this might be some other theme related issue actually.
@soundstrategies I found an HTML template and insert WordPress inside and it was working fine, after the update of AIO SEO, I got an issue.
try to remove <title> definition from header.php file (if it is in place) and add add_theme_support( 'title-tag' ); into functions.php : https://make.ww.wp.xz.cn/core/2014/10/29/title-tags-in-4-1/
https://codex.ww.wp.xz.cn/Title_Tag
the strange part is that title works fine for pages like https://jobsalert.pk/invigilator-jobs-in-ots-2016-online-registration-latest-advertisement/40750 so I probably won’t be able to help you.
Can you try to add Separator and Site Title to the Page Title to see if it will take any effect?
then I think I have to move back to the v3 of AIO SEO
Xaibi,
at the end of your code, after:
<?php endwhile; ?>
try to put:
<?php wp_reset_postdata(); ?>
It might not help, but worth to try.
@soundstrategies if I remove endwhile code get messed up.
Parse error: syntax error, unexpected end of file in /home/jobs/public_html/wp-content/themes/jobs/template-org.php on line 257