Quantcast
Channel: WordPress.org Forums » [Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Support
Viewing all articles
Browse latest Browse all 42467

maxbuxfiy on "[Plugin: WordPress SEO by Yoast] Serious Canonical Issue with Paginated Posts"

$
0
0

OK, I went through the code and found out Yoast made a logical error, maybe he needs more coffee or something :-)

On line 575 of class-frontend.php under the comment // Fix paginated pages canonical, but only if the page is truly paginated.

$numpages = substr_count( $obj->post_content, '<!--nextpage-->' ) + 1;
if ( $numpages && get_query_var( 'page' ) < $numpages ) {

He forgot to cater for the last page in paginated which will be equal to $numpages

Just add '=' so it reads
if ( $numpages && get_query_var( 'page' ) <= $numpages ) {

All set.


Viewing all articles
Browse latest Browse all 42467

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>