Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119528

helgatheviking on "[Plugin: KIA Subtitle] Make it show up in SEO titles (Yoast's plugin)"

$
0
0

You're welcome. I'm glad you like it. I'm not sure I understand what you mean with your custom field name... the sub title is already stored in a meta field. You can retrieve the subtitle information with the get_the_subtitle() function. I believe that Yoast's SEO plugin filters wp_title(). So you could also filter wp_title() and pass in the value from the subtitle field.

Just as a suggestion, you could perhaps try:

function kia_add_subtitle_to_yoast($title){
global;
$subtitle = get_the_subtitle( $post->ID );
if($subtitle){
   $title .= " - " . $subtitle;
}
return $title;
}
add_filter('wp_title','kia_add_subtitle_to_yoast', 99 );

It is totally untested, but might work. Unfortunately I can't really support the SEO plugin. Best of luck.


Viewing all articles
Browse latest Browse all 119528

Trending Articles