boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

get more search engine traffic part 1: page titles

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
[email protected]



Joined: 16 Jul 2002
Posts: 9

PostPosted: Fri Sep 06, 2002 6:16 pm    Post subject: get more search engine traffic part 1: page titles Reply with quote

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
View user's profile Send private message Visit poster's website
Tanner



Joined: 06 Jul 2002
Posts: 55
Location: Germany

PostPosted: Mon Sep 16, 2002 12:15 pm    Post subject: Reply with quote

:?

My provider doesn´t allow ReWriteEngine
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
michel v
Site Admin


Joined: 25 Jan 2002
Posts: 799
Location: Corsica

PostPosted: Mon Sep 16, 2002 1:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group