0

Sorry for this question, but I can't work out why my site name isn't showing in the browser window even though I have wp_title() in the <head>.

All I have done is used CSS to indent the text -9999px so it's off the screen but I thought that would still register as the title in the browser?

When I navigate through to posts, the post name appears, but the site name doesn't appear on those pages either, even though it should appear before the post.

I'm stumped. Any help would be greatly appreciated!

Thanks in advance!


Following on from Will's advice I included the following code in the functions.php:

function twentytwelve_wp_title( $title, $sep ) {
global $paged, $page;

if ( is_feed() )
    return $title;

// Add the site name.
$title .= get_bloginfo( 'name' );

// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
    $title = "$title $sep $site_description";

// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 )
    $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );

return $title;
}

add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

and then changed the <title> tag to the following:

<title><?php wp_title('|', true, 'right'); ?></title>

All seems to be working now! Thanks for your help!

0

CSS will not influence it.

Check your theme's functions.php file (or similar) to see if it's transforming the title.

add_filter( 'wp_title', 'some_function_name' );

You can read more about it in the Codex: https://codex.wordpress.org/Function_Reference/wp_title#Customizing_with_the_filter

0

Could you include all of the code that appears between your header's title tags in your question? It will make it easier to figure out what's wrong…

but in case I miss your response, try this and see if it works:

<?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.