Tweaking the page title
-
Hi, I’m trying to change the way the page title is generated. It seems to currently display as “page or post title | Blog name” – I’m trying to reverse that so that it reads “Blog name | Title”. I’ve tried changing the code in functions.php from `if ( ! function_exists( ‘_wp_render_title_tag’ ) ) :
function ct_tracks_add_title_tag() {
?>
<title><?php wp_title( ‘ | ‘ ); ?></title>
<?php
}
add_action( ‘wp_head’, ‘ct_tracks_add_title_tag’ );
endif;`
to `if ( ! function_exists( ‘_wp_render_title_tag’ ) ) :
function ct_tracks_add_title_tag() {
?>
<title><?php bloginfo(‘name’); ?><?php wp_title(‘ | ‘, ‘echo’, ‘left’); ?></title>
<?php
}
add_action( ‘wp_head’, ‘ct_tracks_add_title_tag’ );
endif;`
But that doesn’t do anything at all. Anyone know how to do this?
- The topic ‘Tweaking the page title’ is closed to new replies.