Topic: How to add meta tags in HEAD section of each news?
I need to manually add meta tags in HEAD section in every news I've created.
How to edit meta tags for each news individually?
Dear CuteNews Users! Please feel free to contact us via our new Feedback Form and please send information about bugs to our bug tracker.
You are not logged in. Please login or register.
CutePHP Forums → Problem Solving / Help & Support → How to add meta tags in HEAD section of each news?
I need to manually add meta tags in HEAD section in every news I've created.
How to edit meta tags for each news individually?
Hello,
This can be done by inserting a code on the page (at the very top of the php page):
require_once ("cn_api.php");
$ entry = cn_api_get_entry ();
And then, somewhere in the code where HEAD is output, for example:
<head>
....
<? If ($ entry) {echo '<meta .... content = "'. $ entry ['tg']. '" />'; }?>
...
</ head>
To output the tags. The way of displaying is given approximately, it will be necessary to correct.
Hello,
This can be done by inserting a code on the page (at the very top of the php page):
require_once ("cn_api.php");
$ entry = cn_api_get_entry ();
Can you precise, where should I insert a code? Which .php file?
And then, somewhere in the code where HEAD is output (...)
You mean I need to put it to a Full Story with HTML enabled in this article?
Dear Support Team,
can you help?
For example, you have the file index.php
<html>
<head>
<title>My site</title>
</head>
<body>
<? include 'cutenews/show_news.php'; $ entry = cn_api_get_entry (); ?>
</body>
</html>
It is necessary to modify the file so that it will be so:
<? require_once ("cn_api.php"); $entry = cn_api_get_entry(); ?>
<html>
<head>
<title>My site </title>
<? if ($entry) {echo '<meta name="description" content="'. $entry['tg']. '" />'; }?>
</head>
<body>
<? include 'cutenews/show_news.php'; ?>
</body>
</html>
Thanks for your help. It's working.
<head>
<title>My site</title>
<? if ($entry) {echo '<meta name="description" content="'. $entry['tg']. '" />'; }?>
</head>
Is it possible to modify that code to get unique title as well?
How to change <title>My site</title> to <title>Article title - My site</title>?
-- Edit
I found it. Just replace 'tg' to 't'.
Changed by a similar method
<? If ($ entry) {echo '<title>'. $ Entry ['t']. '- My Site </ title>'; }?>
MyKFCExperience
For example, you have the file index.php
<html>
<head>
<title>My site</title>
</head>
<body>
<? include 'cutenews/show_news.php'; $ entry = cn_api_get_entry (); ?>
</body>
</html>It is necessary to modify the file so that it will be so:
<? require_once ("cn_api.php"); $entry = cn_api_get_entry(); ?>
<html>
<head>
<title>My site </title>
<? if ($entry) {echo '<meta name="description" content="'. $entry['tg']. '" />'; }?>
</head>
<body>
<? include 'cutenews/show_news.php'; ?>
</body>
</html>
Many thanks for that complete information!
CutePHP Forums → Problem Solving / Help & Support → How to add meta tags in HEAD section of each news?
Powered by PunBB, supported by Informer Technologies, Inc.
The pun_antispam official extension is installed. Copyright © 2003–2009 PunBB.