I have facing a problem with title tag rewrite due to SEO Ultimate Plugin function, if will customize function in SEO plugin then it's loss when i update plugin.
if anyone have solution for it please share with me
thanks in advance
- 1 like
- 1 comment
Manish Singh |23 Mar at 01:03
I have facing a problem with title tag rewrite due to SEO Ultimate Plugin function, if will customize function in SEO plugin then it's loss when i update plugin.
if anyone have solution for it please share with me
thanks in advance
Dhananjay Kumar23 Mar at 02:03
I have a solution for you, Please use the below code above the <title> tag in header.php
$uri=explode("/",$_SERVER['REQUEST_URI']);
$slug=$uri[2];
$taxonomy_names = get_term_by('slug',$slug,'taxonomy name');
$term_meta = get_term_meta( $taxonomy_names->term_id );
global $titlereplacemeta;
$titlereplacemeta=$term_meta[custom field name][0];
$fpath=$_SERVER['DOCUMENT_ROOT']."/wp-content/plugins/seo-ultimate/modules/titles/titles.php";
if(is_file($fpath)){
$str=file_get_contents($fpath);
if(!strstr($str,'global $titlereplacemeta')){
$to='$title = $this->get_title();';
$rplto='global $titlereplacemeta;if($titlereplacemeta!=""){ $title = $titlereplacemeta; }else{ $title = $this->get_title();}';
$str=str_replace($to, $rplto,$str);
file_put_contents($fpath, $str);
}
}
?>