google-code-backups / get-simple-cms

Automatically exported from code.google.com/p/get-simple-cms
GNU General Public License v3.0
0 stars 0 forks source link

meta description and keywords #299

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There's a piece of code that is no longer being used in theme_functions.php , 
function get_header(), everything between lines 276 to 295. Variables 
$description and $keywords are assigned some values, but not used later.

This remaining code is because that was the way the description and keywords 
were generated in GS 3.0, but in r616 this was changed so that desc and keys 
are echoed by get_page_meta_desc() and get_page_meta_keywords().

However the excerpt that was inserted into the meta description in GS 3.0 (when 
the page's description field is empty) is no longer generated. (I honestly 
didnt like that excerpt, but it was so because Chris liked it this way :-))

Suggested patch: Change line 296 to:
echo '<meta name="description" content="'.$description.'" />'."\n";

(I would make this optional and/or generated in a different way, but I'll leave 
it for a future issue for now...)
----

And now keywords. We have line 294 assigning $keywords, with is not used later. 
 So you can choose to remove that line, or else using the variable in line 297, 
that would be changed to:
echo '<meta name="keywords" content="'.$keywords.'" />'."\n";

Another possibility is just not echoing this meta if the field is empty. So it 
could be (line 297):
if ($keywords != '') echo '<meta name="keywords" content="'.$keywords.'" 
/>'."\n";

Original issue reported on code.google.com by carnav on 18 Feb 2012 at 10:48

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r659.

Original comment by ccagle8 on 19 Feb 2012 at 2:26