Need help in PHP code to get a seperate meta tag

Discussion in 'PHP' started by Andy_ameed, Jan 17, 2010.

  1. #1
    The site has index.php as the main page. and it calls wrapper.html to index.

    meta description part of wrapper.html is this.

    <meta name="description" content="{$description}">
    Code (markup):
    so it takes any thing inside a description tag as the description of the page.

    The warpper has 10 sites listed in main page: and each has a description tag. so the thing is it takes random tags every time. this is very much hurting the seo of the site.

    and if i remove {$description} from meta tag: every enlisted site in the directory is having one description and its also bad for.

    here what i need is a code that can add description to main page without interfering with the descriptions on individual sites pages.
     
    Andy_ameed, Jan 17, 2010 IP
  2. astkboy2008

    astkboy2008 Peon

    Messages:
    211
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try to use temeplte engine
     
    astkboy2008, Jan 17, 2010 IP
  3. astkboy2008

    astkboy2008 Peon

    Messages:
    211
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ooooooooooooooooooh
    its easy my dear
    add this variable in the main page only

    $description = 'your desc';
    and if it linked by templete engine you must assign it
     
    astkboy2008, Jan 17, 2010 IP
  4. scottlpool2003

    scottlpool2003 Well-Known Member

    Messages:
    1,708
    Likes Received:
    49
    Best Answers:
    9
    Trophy Points:
    150
    #4
    I split my header and footer up and include them using php like so:


    In my head.php I have the following code:

    Then in the content area I have:

    I hope this helps.
     
    scottlpool2003, Jan 17, 2010 IP