Created
November 2, 2016 18:29
-
-
Save gareth-gillman/cf08a6bbb469e000a8fb5441b1614d48 to your computer and use it in GitHub Desktop.
Add Page number to the WordPress page title for SEO benefits
This file contains 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
function my_blog_number_title($titletag) { | |
if( is_paged() ) { | |
global $wp_query; | |
$pagenum = $wp_query->query_vars['paged']; | |
$new_title = $titletag.' Page '.$pagenum; | |
$titletag = str_replace($titletag, $new_title ,$titletag); | |
return $titletag; | |
} | |
} | |
add_filter('wp_render_title_tag_filter','custom_wp_render_title_tag'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment