Skip to content

Instantly share code, notes, and snippets.

@daviddegliame
Created August 6, 2015 08:00
Show Gist options
  • Select an option

  • Save daviddegliame/fd0d29a807990b9ef735 to your computer and use it in GitHub Desktop.

Select an option

Save daviddegliame/fd0d29a807990b9ef735 to your computer and use it in GitHub Desktop.
Wordpress avec le framework genesis : modifier la meta title sur les pages et archives avec une pagination …
<?php
// in function.php of your theme or in mu-plugin file …
//* SEO - fight duppplicate meta title on paginate section
add_filter( 'wp_title', 'genesis_paginate_title', 35, 3 );
if (!function_exists('genesis_paginate_title'))
{
function genesis_paginate_title($title, $sep)
{
global $page, $paged;
$sep = genesis_get_seo_option( 'doctitle_sep' ) ? genesis_get_seo_option( 'doctitle_sep' ) : '–';
if ( $paged >= 2 || $page >= 2 )
$title .= ' '.$sep.' '.sprintf( __( 'Page %s' ), max( $paged, $page) );
return $title;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment