Is there a way ( not WP ) by the way, of generating dynamic metas?
I dont mean random, and essentially i am talking of description tag only.
I was gonna fire php include in the description tag , and wondered can we append an id / var to that include…sort of like a hashtag.
Then the include file would be a list we create prepended by id ..so as an example.
Page about.php loads and calls include/metas.php#about
Then in include file we somehow reference tht id ?
Any suggestions ?
http://voices.yahoo.com/use-php-generate-dynamic-meta-tags-634388.html?cat=35
http://stackoverflow.com/questions/10689600/generate-dynamic-meta-tags-based-on-url
Crakken said
Try it first, then tell us what you get. These may be helpful:
http://voices.yahoo.com/use-php-generate-dynamic-meta-tags-634388.html?cat=35
http://stackoverflow.com/questions/10689600/generate-dynamic-meta-tags-based-on-url
Yer nah all of that I can inc canonical urls etc. Same for all other meta tags.
The issue I have is with Description Tag. I dont want to scrape page, for this particular exercise . I want to create my include file with like a ul li list ( obviously it wouldnt be that ) but a list so like:
#about = We are a great company based in Alaska #contact = You can contact our offices anytime #faq = frequently asked questions..
blah blah blah..
then in head of say about page: <?php include(’/includes/metas.php?about’); ?>
etc etc
Im not that savvy with php, but enough to get me by. Just wondered if a include ( i know by definition INCLUDES the content specified ) but could load particular DATA from a singular url
You could try this:
Create a file called metas.php and paste the following code:<?php
if($page=='about'){$description='We are a great company based in Alaska';}
if($page=='contact'){$description='You can contact our offices anytime';}
if($page=='faq'){$description='frequently asked questions..';}
?> etc..etc
Add the following to each page before you call the metas.php file and before the meta description tag
$page='contact'; on the contact page$page='about'; on the about page..etc..etcand call the <?php include(’/includes/metas.php’); ?> in the head of each page and use the meta description tag like this:
<meta name="description" content="<?php echo $description ?>" />
I havent tested it but it should work
Mal
Cheers yup thats exactly what we ave decided to do, great explanation. Thankyou…wheres the thanks button 
<?php
if ($_GET["page"] == "about") {
$description = "We are a great company based in Alaska";
} elseif ($_GET["page"] == "contact") {
$description = "You can contact our offices anytime";
} elseif ($_GET["page"] == "faq") {
$description = "frequently asked questions..";
} else {
$description = "Whatever else you want...";
}
?>
Then call the metas.php file on each page like that: <?php include("/includes/metas.php?page=about"); ?> for the about description and do the same for the others. Now on each page, just do:
<meta name="about" description="<?php echo $description; ?>" />Thanks @cracken
Thats cool
Appreciate your effort, thankyou very much. Have now completed it all, across entire site. Works a charm 
Ste
SportTipsWorld said
Thanks @crackenThats cool
SteAppreciate your effort, thankyou very much. Have now completed it all, across entire site. Works a charm
No problem. It’s “Crakken” by the way 
Lol sorry, worked thru the night.
Always reminds me an old joke , Phil McCrakken …best not expand on that
SportTipsWorld said
Lol sorry, worked thru the night. Always reminds me an old joke , Phil McCrakken …best not expand on that
Lol, actually it’s Phil “McCracken” but it’s okay 
