Check-in; adding features like mixshow and google analytics.
This commit is contained in:
parent
36e6e23a68
commit
8288ebc67a
50 changed files with 1492 additions and 483 deletions
21
includes/hreflang.php
Normal file
21
includes/hreflang.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
// based on the page that called this include, we will set the hreflang
|
||||
|
||||
$languages = $config['locales'];
|
||||
|
||||
$list = [];
|
||||
|
||||
// for every key, rewrite it to be just the language code.
|
||||
// for example, fil_PH becomes fil; taking note that we are removing _ and everything that follows
|
||||
foreach ($languages as $key => $value) {
|
||||
$key2 = str_replace('_', '-', $key);
|
||||
$list[] = '<link rel="alternate" hreflang="' . $key2 . '" href="' . $config['app']['url'] . '/?lang=' . $key . '"/>' . PHP_EOL;
|
||||
}
|
||||
|
||||
// dedupe $list
|
||||
$list = array_unique($list);
|
||||
|
||||
foreach ($list as $link) {
|
||||
echo $link;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue