Created
August 19, 2021 07:59
-
-
Save mihdan/de9ed614cb17769f99bdc7a08f85e320 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function return_canon () { | |
$canon_page = get_pagenum_link( 1 ); | |
return $canon_page; | |
} | |
function canon_paged() { | |
if ( is_paged() ) { | |
add_filter( 'wpseo_canonical', 'return_canon' ); | |
} | |
} | |
add_filter( 'wpseo_head','canon_paged' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment