Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
563 views
in Themes by
Why i dont get PAGE DESCRIPTION?
 
function head()
{
$this->output(
'<head>',
'<meta http-equiv="content-type" content="'.$this->content['content_type'].'"/>'
 
);
 
$this->head_title();
$this->head_metas();
$this->head_css();
$this->head_links();
$this->head_lines();
$this->head_script();
$this->head_custom();
 
$this->output('</head>');
}
 
function head_title()
{
$pagetitle=strlen($this->request) ? strip_tags(@$this->content['title']) : '';
$headtitle=(strlen($pagetitle) ? ($pagetitle.' - ') : '').$this->content['site_title'];
 
$this->output('<title>'.$headtitle.'</title>');  - This show me the site title, it works
}
 
function head_metas()
{
if (strlen(@$this->content['description']))
$this->output('<meta name="description" content="'.$this->content['description'].'"/>');   - This doesnt show me page description. How can i add page 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'].'"/>');
}

1 Answer

+1 vote
by
Your way is very difficult. there're some more easy ways.

You cand add description via admin centre. Admin-> Layout ->  Custom HTML in <head> section.  To this section add this <meta name="description" content=" this is question to answer web site"/>

Also you can add to this section key words

<meta name="keyword...

Programmers always look for easy way of solving problem
...