I'm sorry if this is covered somewhere but search wasn't working for me. I'm wondering how to generate page specific titles and meta tags using php. The way my site is currently set up there's are header and footer pages which show up on each page and then the content page which is separate. It makes editing easier, but it means that even though I have unique content on each page they all have the same page title and meta tags. Is there a way to code it so that the page title and meta tags are pulled from the content section rather than the header or do I just need to have everything on one page so I can manually change the meta info for each page? Thanks for any help.
couple of different ways you could approach this... 1.) you could put the page titles and data into an array and run a page check and if it matched the page.php then produce the proper results. 2.) You could have text files for the pages and then do an array of page.php and then extract the data from those text files if it matches 3.) you could hard code it into your header.php file and do a bunch of if statements and it would check against a page to see what data it's supposed to pull ex: if($page === "test.php"){ $title = "My Test Page"; $meta_tags = "Testing, test, testie, mr testies"; $med_desc = "This is my testing page"; } Then just call it in your header page
Thanks for the response. #3 probably sounds easiest since my coding skills ended with me being able to create a table with HTML. You said to call it in the header... What does that mean? Thanks again!