Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to override category product from seo title and description

add_filter( 'wpseo_title', 'uppercase_seo_title' );
function uppercase_seo_title( $title ) {
 global $post;
$cate = get_queried_object();
$cate_name = $cate->name;
$product_name = get_the_title();
if(is_tax('product_cat')){ 
$title = "Buy".' '. $cate_name .' - '. "UK's Best Online Price";	
}
else if(is_product()){
	$title = "Buy".' '. $cate_name .' '. $product_name .' - '. " UK's Best Online Price";
}
return $title;
}
add_filter('wpseo_metadesc','jkc_custom_meta');
function jkc_custom_meta($desc){
	global $post;
	$cate = get_queried_object();
	$cate_name = $cate->name;
	$product_name = get_the_title();                          
			if(is_tax('product_cat')){ 

			$desc = "Looking for".' ' .$cate_name. " ? Japanese knife company provide you original Japanese premium quality".' '. $cate_name .' '. "with the UK's best online price.";
			}
			else if(is_product()){
				$desc = "Looking for".' ' .$product_name. " ? Japanese knife company provide you original Japanese premium quality".' '. $cate_name .' '. "with the UK's best online price.";
			}
			return $desc;
}
	
 
PREVIOUS NEXT
Tagged: #override #category #product #seo #title #description
ADD COMMENT
Topic
Name
8+9 =