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

ggg377 on "[Plugin: WordPress SEO by Yoast] Not showing a category in posts title tag?"

$
0
0

Hi again. It's unfortunate this thread hasn't generated any interest. I've been working on a solution and here's some thoughts on this issue:

1) Would it be possible to set a custom title for single posts through the if is_single function and the required WordPress SEO title (<title><?php wp_title (''); ?></title>) for everything else through php else?

2) I was able to pinpoint these lines in wpseo-functions.php:

'%%category%%'     => wpseo_get_terms( $r->ID, 'category' ),
function wpseo_get_terms( $id, $taxonomy, $return_single = false ) {
	// If we're on a specific tag, category or taxonomy page, return that and bail.
	if ( is_category() || is_tag() || is_tax() ) {
		global $wp_query;
		$term = $wp_query->get_queried_object();
		return $term->name;
	}

Perhaps altering this could allow for excluding a single category?

Thanks,

ggg377


Viewing all articles
Browse latest Browse all 42467

Trending Articles



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