Jump to content

Meta tags not loading dynamically... Why? (CodeIgnitor)


Recommended Posts

Hi guys,


I am trying to have unique meta tags for each page. So far, this code is only loading the DEFAULT meta tags, and I just can’t see why it isn’t working with my individual pages with their unique meta content. :(


I have my header.php with this code directly after the opening head tag:


if(!isset($meta)) {
$meta = array(
                 array('name'=>'description', 'content'=>'A short but sweet DEFAULT description of this fine site'),
                 array('name' =>'keywords', 'content'=>'some awesome DEFAULT keywords for those rascally web crawlers')

more php here.....

<link rel="shortcut icon" type="image/x-icon" href="img/fav.ico">
<meta charset="UTF-8" />

<!--This is where I am calling the meta function-->
<?php echo meta($meta);?> 

More php and html goes here...


And then this is what I am putting in all of my pages (except for my header.php, of course!), before I include the header:


$meta = array(
                array('name'=>'description', 'content'=>'Another short but sweet description'),
                array('name' =>'keywords', 'content'=>'Mmmmm. Yummy keywords for you to savor')


html stuff goes here 


Any thoughts, or ideas on this matter, please? :wtf:


Thanks so much!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.