I want to set term name as variable
if(isset($wp_taxonomies)) {
$term = get_term_by(
'slug',
get_query_var('term'),
get_query_var('taxonomy')
);
if($term) {
// do stuff
}
}
function assignPageTitle(){
return $term>name;
}
add_filter('wp_title', 'assignPageTitle');
get_header();
This code is in the taxonomy.php file and the $term>name; returns the name, but only if I echo, on the title is giving me these errors:
Notice: Use of undefined constant name - assumed 'name' in /home/jshomesc/public_html/wp-content/themes/jshomes/taxonomy.php on line 12
Notice: Undefined variable: term in /home/jshomesc/public_html/wp-content/themes/jshomes/taxonomy.php on line 12