Welcome Guest, Not a member yet? Register   Sign In
Customizing Title and Meta Tag for SEO
#11

[eluser]Rolly1971[/eluser]
please note that the following is just my personal opinion.

Code:
<?php
echo "<META http-equiv='Content-Type' content='text/html; charset=utf-8' />"."\n";
echo "<TITLE>".$html_title."</TITLE>"."\n";
echo "<META name='title' content='".$meta_title."' />"."\n";
echo "<META http-equiv='expires' content='".$expires."' />"."\n";
echo "<META http-equiv='pragma' content='".$pragma."' />"."\n";
echo "<META name='author' content='".$meta_author."' />"."\n";
echo "<META name='keywords' lang='en-us' content='".$meta_keywords."' />"."\n";
echo "<META name='description' content='".$meta_description."' />"."\n";
echo "<META name='ROBOTS' content='".$meta_robots."' />"."\n"; // robots page directive
echo "<base href=".base_url()." />";

echo "<style type='text/css' media='all'>@import url('css/twpd.css');</style>"."\n";
echo "<link rel='stylesheet' type='text/css' media='all' href='css/twpd.css' />"."\n";

/* End of file ./application/views/twpd/page_header.php */

why on god's green earth are you echoing the meta tags using php????? what's wrong with you???? this drives me spare, when i see these types echo statements it makes me wanna barf. there are times and places to do this stuff, and in a view file is NOT imho the time to do this.

personally i think it looks cleaner and is just better written like this:

Code:
<META http-equiv="Content-Type" content="text/html; charset=utf-8" />
<TITLE><?php echo $html_title; ?></TITLE>
<META name="title" content="<?php echo $meta_title; ?>" />
<META http-equiv="expires" content="<?php echo $expires; ?>" />
<META http-equiv="pragma" content="<?php echo $pragma; ?>" />
<META name="author" content="<?php echo $meta_author; ?>" />
<META name="keywords" lang="en-us" content="<?php echo $meta_keywords; ?>" />
<META name="description" content="<?php echo $meta_description; ?>" />
<META name="ROBOTS" content="<?php echo $meta_robots; ?>" />
<base href="<?php echo base_url(); ?>" />

<link rel="stylesheet" type="text/css" media="all" href="css/twpd.css" />

sorry for the nit picking rant.


Messages In This Thread
Customizing Title and Meta Tag for SEO - by El Forum - 07-15-2012, 01:22 PM
Customizing Title and Meta Tag for SEO - by El Forum - 07-15-2012, 03:39 PM
Customizing Title and Meta Tag for SEO - by El Forum - 07-16-2012, 10:14 AM
Customizing Title and Meta Tag for SEO - by El Forum - 07-16-2012, 10:28 AM
Customizing Title and Meta Tag for SEO - by El Forum - 07-16-2012, 10:37 AM
Customizing Title and Meta Tag for SEO - by El Forum - 07-16-2012, 01:44 PM
Customizing Title and Meta Tag for SEO - by El Forum - 07-16-2012, 06:28 PM
Customizing Title and Meta Tag for SEO - by El Forum - 07-17-2012, 03:40 AM
Customizing Title and Meta Tag for SEO - by El Forum - 07-17-2012, 08:27 AM
Customizing Title and Meta Tag for SEO - by El Forum - 07-17-2012, 09:07 PM
Customizing Title and Meta Tag for SEO - by El Forum - 07-17-2012, 10:51 PM
Customizing Title and Meta Tag for SEO - by El Forum - 07-17-2012, 11:27 PM
Customizing Title and Meta Tag for SEO - by El Forum - 07-18-2012, 04:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB