How to customize a title by passing query string?
use the wp_title filter. just remove all your code from header.php and put this into your plugin instead: add_filter( ‘wp_title’, ‘my_wp_title’, 10, 2 ); function my_wp_title( $title, $sep = ‘|’ ) { if ( is_page( physician_single_pg() ) and get_query_var( ‘doctor’ ) ) { $doctor = get_query_var( ‘doctor’ ); $title = … // here you put … Read more