Craptacular Posted June 1, 2012 Share Posted June 1, 2012 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: <?php 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') ); } ?> <?php $this->load->helper('html'); ?> more php here..... ..... ..... ..... <title> ... </title> <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: <?php $meta = array( array('name'=>'description', 'content'=>'Another short but sweet description'), array('name' =>'keywords', 'content'=>'Mmmmm. Yummy keywords for you to savor') ); $this->load->view('includes/header'); ?> html stuff goes here Any thoughts, or ideas on this matter, please? Thanks so much! Link to comment https://forums.phpfreaks.com/topic/263503-meta-tags-not-loading-dynamically-why-codeignitor/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.