Support » Plugin: All in One SEO Pack » Title rewrite not working

  • Resolved narayan.changder

    (@narayanchangder)


    Hi;
    Thank for this great plugin. I want to rewrite the title for some post. (The below code was working earlier but suddenly stopped working)

    function wp_title() {
    		if ( ! $this->is_seo_enabled_for_cpt() ) {
    			return;
    		}
            
    		global $aioseop_options;
    		global $Changed_Title;
    		$title = false;
    		$post  = $this->get_queried_object();
    		$title = $this->get_aioseop_title( $post );
    		$title = $this->apply_cf_fields( $title );
    
    		if ( false === $title ) {
    			
    			$title = $this->get_original_title();
    		}
    		 
            if(get_post_type($post )=="post"){
    		$postcat = get_the_category( $post->ID );		
    		 
    		$category =$postcat[0]->cat_ID;		
    	    
    		if($category==281){
    			$title=strtoupper($Changed_Title);			  
    			 
    		}
    		 }
    		
    		 echo $title;
    		return apply_filters( 'aioseop_title', $title );
    		
    	}

    using this code the page is showing the $title value but page_title is not changing. When I add $title=’Hi’.$title; the title changes to Hi. Could you please help me to resolve this problem.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.