Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
2.8k views
in Q2A Core by

If you add meta tags in the admin section, you will get two sets of meta tags.

This function already calls up some meta tags and it gets the wrong ones.

 

  function head_metas()
                {
                        if (strlen(@$this->content['description']))
                                //$this->output('<META NAME="description" CONTENT="'.$this->content['description'].'"/>');
                        
                        if (strlen(@$this->content['keywords'])) // as far as I know, META keywords have zero effect on search rankings or listings
                                $this->output('<META NAME="keywords" CONTENT="'.$this->content['keywords'].'"/>');
                }
 
This is what I get without adding tags in admin and meta tags should show in first head section
 
		<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="generator" content="Mmogwiki.net">
    <meta name="dcterms.created" content="Wed, 12 Dec 2012 07:26:32 GMT">
    <meta name="description" content="Discount Auto Parts">
    <meta name="keywords" content="auto parts,discount, 10% off">
    <title></title>

 

I see that it does nothing when I add a meta discription in the admin

I know the function that callls this meta tags up, but wherte is it in a file so I can change the tags my self

http://mmogwiki.net

Thanks

Q2A version: 1.5.4

1 Answer

+1 vote
by
Where are you adding the meta in the admin area? Because there is only one place that I can see, Admin > Layout > "Include <META> description for home page" which works fine for me and only adds that meta description on the home page.

If you are putting meta tags in the "Custom HTML in <HEAD> section of every page" option, then yes they will appear on every page. That section isn't intended for description tags.

I'll also repeat that meta keywords are worse than useless and should be nuked from orbit. Dunno why that ever got added to Q2A in the first place...
by
I am not adding them anywhere. I am just saying it would be nice if the function would put them in the first head instead of the second one. The function is picking up words off the banner at the top and bottom and putting them in a second head section.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
    <!-- Powered by Question2Answer - http://www.question2answer.org/ -->
    <HEAD>
        <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=utf-8">
        <TITLE>Mmogwiki Free Automotive Questions &amp; Answers</TITLE>
        <LINK REL="stylesheet" TYPE="text/css" HREF="./qa-theme/Pixel_n_Grain_Dark_V_D1.1/qa-styles.css?1.5.4">
        <style>
            .notify-container {
    left: 0;
    right: 0;
    top: 0;
    padding: 0;
    position: fixed;
    width: 100%;
    z-index: 10000;
}
.notify {
    background-color: #F6DF30;
    color: #444444;
    font-weight: bold;
    width: 100%;
    text-align: center;
    font-family: sans-serif;
    font-size: 14px;
    padding: 10px 0;
    position:relative;
}
.notify-close {
    color: #735005;
    cursor: pointer;
    font-size: 18px;
    line-height: 18px;
    padding: 0 3px;
    position: absolute;
    right: 8px;
    text-decoration: none;
    top: 8px;
}
.qa-faq-section-title {
    font-size:125%;
    font-weight:bold;
    margin:10px 0 5px;
    cursor:pointer;
}
.qa-faq-section-text {
    display:none;
    margin:0 0 10px 10px;
}
        </style>
        <LINK REL="alternate" TYPE="application/rss+xml" HREF="./?qa=feed/qa.rss" TITLE="Recent questions and answers">
        <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="generator" content="Mmogwiki.net">
    <meta name="dcterms.created" content="Wed, 12 Dec 2012 07:26:32 GMT">
    <meta name="description" content="Discount Auto Parts">
    <meta name="keywords" content="auto parts,discount, 10% off">
    <title></title>
by
Where are the two parts of that code coming from? I think there is some problem with your theme or something, because there should only be one head section (see the source of this site).

Are you adding the second part of that code somewhere, from <!DOCTYPE onwards?
by
I have not added anything in the php files anywhere and I have nothing in the admin in the box for meta . I am using Pixel_n_Grain_Dark_V_D1.1. I guess I could set it to default and see if it is still there. I have changed no functions at all. Thanks Bo
...