Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #109 from CaraWang/google-news/alternate-info
Browse files Browse the repository at this point in the history
Add annotation in the type of google-news sitemap
  • Loading branch information
Roumen Damianoff authored and Roumen Damianoff committed Jun 8, 2016
2 parents 9a88a18 + 001879c commit c39282d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/views/google-news.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
<loc><?= $item['loc'] ?></loc>
<?php
if ($item['lastmod'] !== null) {
echo "\t" . '<lastmod>' . date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) . '</lastmod>' . "\n";
echo '<lastmod>' . date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) . '</lastmod>' . "\n";
}
?>
<?php
if (!empty($item['alternates'])) {
foreach ($item['alternates'] as $alternate) {
echo '<xhtml:link rel="alternate" media="' . $alternate['media'] . '" href="' . $alternate['url'] . '" />' . "\n";
}
}
?>
<news:news>
Expand Down

0 comments on commit c39282d

Please sign in to comment.