I would like to see a single post of my wordpress site having a title only specified in the source code, so that what appears in the browser would be the same that would appear in the source code. Example: Browser: Google Buys Microsoft Source code: <title>Google Buys Microsoft</title> What I have now is website title and title of the post in the source code, which is not good. Thanks for your help.
When you open the template file look for the part where your header is made. If you have a file called header.php start there Take a look at the code and see if you find this line or something like it <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title> Code (markup): Replace it with <title><?php if ( is_single() ) { wp_title();}else{ bloginfo('name');}?></title> Code (markup):
I just finished implementing the code suggested above by Edynas and this is what I got from my source code in the browser: <title> » Title of the Article Here Sample</title> The additional characters ( » ) seem unrelated?
Hi Edynas, I just added the code that you provided, nothing else, and that's what I got. I can't figure out why those extra characters appear in the source code when I couldn't see them in the header file.
It's the wp_title() function call. Wordpress designed wp_title() to be used in conjunction with the blog name - so that a normal title would be "My Blog >> Article Name." You can specify what character appears by passing a parameter to wp_title(). The default is the » you got. If you pass a blank string to wp_title(), it might still use the default - but if you pass a space (' '), it should print just the space. Try either of these as the wp_title() function call and see what happens... wp_title(''); wp_title(' '); PHP: Good luck, - Walkere
Hi Walkere, I use this one: wp_title(''); and I got this result: <title> Will Google Buy All Online Advertising Networks?</title> So there is a white space before "Will Google....." How can we remove that white space, Walkere?