php – Changing Meta Tags
-
Can someone ‘please’ give a WP (nubie) & PHP (nubie) some guidenance… I am trying to use Meta Tags for ‘description’ and ‘keywords’ and I currently have them in the header.php file -OK- I would like to have different Tags – I am (thinking) about something like:
<?php pgName=get_the_title(); -or- pgName=is_page();
if (pgName==”Home”)
<meta name=”description” content=”Home Stuff”
<meta name=”keywords” content=”Home Stuff”;
elseif (pgName==”Page 1″)
<meta name=”description” content=”Page 1″
<meta name=”keywords” content=”Page 1 Stuff”;
elseif (pgName==”Page 2″)
<meta name=”description” content=”Page 2 Stuff”
<meta name=”keywords” content=”Page 2 Stuff”;
else
<meta name=”description” content=”Default Stuff”
<meta name=”keywords” content=”Default Stuff”;
?>
I am sooooo new to this stuff – would something like this even begin to work ??? If so, please ‘code’ it properly for me…
Thanks in advance for your help,
Paul
- The topic ‘php – Changing Meta Tags’ is closed to new replies.