Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2015-12-03 14:18:06

kosm
Member
Registered: 2015-12-02
Posts: 5

FluxBB Fitnet Manager - SEO Title integration

Hi,
I'm sharing with you the update I've done on the title of each page, in order to have it <=70 characters, to fit google need (SEO).
This code is in header.php and replace this part:

<title><?php echo generate_page_title($page_title, $p) ?></title>

Here it is:

<title><?php 	//Managing the title in order that it fits the SEO <71
	if(count($page_title) == 1){echo($page_title[0]);}	//Title only contains main name of Forum
	if(count($page_title) == 2)		//Title contains a forum's name/submenu's name + Main name 
	{
		echo($page_title[1]." - ".$page_title[0]);
	}
	if(count($page_title) >= 3)	//Title contains name of discussion+forum's name+main name(or more)
	{
		$title0=$page_title[2]." - ".$page_title[1]." - ".$page_title[0];	//all
		$title1=$page_title[2]." - ".$page_title[1];		//name of discussion + name forum
		$title2=$page_title[2];					//name of discussion
		
		if(strlen($title0)<71){echo($title0);}			//If all < 71, echo all
		elseif(strlen($title1)<71){echo($title1);}		//If all > 71, echo name of discussion + name forum
		elseif(strlen($title2)<71){echo($title2);}		//If name of discussion + name forum > 71, echo name of discussion
		else{echo($page_title[0]);}				//If name of discussion > 71, echo main name of the forum
	}
?></title>

It works great for me, let me know if you have any thought/advice/question about it!
btw here is the forum:http://forum.fitnetmanager.com/
Cheers

Cosme

EDIT:
you'll have the same title for a forum having different pages! (any idea how to improve this?)
Same title also for discussion having a too long name!

Last edited by kosm (2015-12-03 14:29:51)

Offline

#2 2015-12-04 08:22:33

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: FluxBB Fitnet Manager - SEO Title integration

That's why the old function has pagination included wink

Might be better simply to adapt that function instead since it already uses (Page 1) .etc.

Offline

#3 2015-12-04 08:58:30

kosm
Member
Registered: 2015-12-02
Posts: 5

Re: FluxBB Fitnet Manager - SEO Title integration

Hi!
by "The old function" you mean the one before I modified it or one which was used in  a previous version of fluxbb?
I might get the number of the page from the url to add it to the title in order to have a unique title for each page.
On the other hand having a page number in the title looks bad and uses space...

Offline

#4 2015-12-04 09:32:23

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: FluxBB Fitnet Manager - SEO Title integration

Yes, I meant the function that FluxBB used. At the moment this only shows the page number if you're not viewing the first page.

Offline

#5 2016-03-20 12:39:54

ErikWiz
New member
Registered: 2016-03-19
Posts: 1

Re: FluxBB Fitnet Manager - SEO Title integration

I thought Google only showed 55 characters for the title and 150 for description. Anything over that gets cut off.

Offline

Board footer

Powered by FluxBB