View previous topic :: View next topic |
Author |
Message |
[email protected]
Joined: 16 Jul 2002 Posts: 9
|
Posted: Fri Sep 06, 2002 6:16 pm Post subject: get more search engine traffic part 1: page titles |
|
|
I have been told the Google in particular pays an inordinate amount of attention to the HTML title of the page when ranking search results.
I made it so that in single post (permalink view) the blog entry title shows up as the HTMl page title. Here's how: http://ncyoung.com/permaLink/89 |
|
Back to top |
|
 |
Tanner
Joined: 06 Jul 2002 Posts: 55 Location: Germany
|
Posted: Mon Sep 16, 2002 12:15 pm Post subject: |
|
|
:?
My provider doesn´t allow ReWriteEngine |
|
Back to top |
|
 |
michel v Site Admin
Joined: 25 Jan 2002 Posts: 799 Location: Corsica
|
Posted: Mon Sep 16, 2002 1:53 pm Post subject: |
|
|
This is a template tag from the next release, that does just what you need.
[php:1:3eae48aece]function single_post_title($prefix = '', $display = 1) {
global $p;
if (intval($p)) {
$post_data = get_postdata($p);
if ($display) {
echo $prefix.strip_tags(stripslashes($post_data['Title']));
} else {
return strip_tags(stripslashes($post_data['Title']));
}
}
}[/php:1:3eae48aece]
You use it like that:
[php:1:3eae48aece]<?php /* don't delete this line */ $blog=1; include('blog.header.php'); ?>
<html>
<head>
<title>my blog's title <?php single_post_title(':: '); ?></title>
</head>
<body>
...other template tags go here...
</body>
</html>[/php:1:3eae48aece]
It works like that: if you load the page without a 'p' parameter, it won't display anything but "my blog's title", but if you load it with ?p=something, it would display "my blog's title :: this post's title". |
|
Back to top |
|
 |
|