man5 Posted February 22, 2014 Share Posted February 22, 2014 For instance, say I have a metas.php file. It includes the meta tags for 20 other pages in the website. What is the best way to generate relevant meta tags from metas.php and into 20 individual pages? Quote Link to comment Share on other sites More sharing options...
Augury Posted February 22, 2014 Share Posted February 22, 2014 Whats a meta tag? Quote Link to comment Share on other sites More sharing options...
Strider64 Posted February 22, 2014 Share Posted February 22, 2014 (edited) You can always a header.inc.php of some kind and just include at the top of you web pages: For example: <?php require('lib/includes/utilities.inc.php'); include 'lib/includes/header.inc.php'; ?> You can also do something like this (although a little more elaborate in your case) inside the header.inc.php file: if (preg_match("/J.R. Pepp | Website Design/i", $pageTitle)) { $metaDesc = '<meta name="description" content="J.R. Pepp is a Website Design and Development Company based in Livonia, Michigan.">'; } That way all you meta tags (elements) will be on every page and appropriate depending on the page. An for the question what is a meta tag? "Meta elements are the HTML or XHTML <meta … > element used to provide structured metadata about a Web page. Multiple Meta elements with different attributes are often used on the same page. ..." Edited February 22, 2014 by Strider64 Quote Link to comment Share on other sites More sharing options...
Augury Posted February 22, 2014 Share Posted February 22, 2014 post metas.php. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.