SMP
💖 Chevereto Fan
Looking at the error log i found this
PHP Fatal error: Call to undefined function get_album() in /home/site/public_html/app/themes/pic/header.php on line 89
and the line 89 is this one below
PHP Fatal error: Call to undefined function get_album() in /home/site/public_html/app/themes/pic/header.php on line 89
and the line 89 is this one below
Code:
$twitter_card['creator'] = get_album()['user']['twitter']['username'];
PHP:
// Set twitter card
$twitter_card = [
'card' => 'summary',
'description' => function_exists('get_meta_description') ? get_meta_description() : NULL,
'title' => G\str_replace_last(' - ' . CHV\getSetting('website_name'), NULL, get_doctitle()),
'site' => CHV\getSetting('twitter_account') ? ('@' . CHV\getSetting('twitter_account')) : NULL
];
switch(true) {
case G\is_route('image'):
$twitter_card['card'] = 'photo';
break;
case G\is_route('album'):
case G\is_route('user'):
$twitter_card['card'] = 'gallery';
if(G\is_route('album')) {
$twitter_card['creator'] = get_album()['user']['twitter']['username'];
} else {
$twitter_card['creator'] = get_user()['twitter']['username'];
}
$list_output = function_exists('get_list') ? get_list()->output_assoc : NULL;
if(count($list_output) > 0) {
for($i=0; $i<4; $i++) {
$twitter_card['image' . $i] = $list_output[$i]['display_url'];
}
}
break;
}
foreach($twitter_card as $k => $v) {
if(!$v) continue;
echo '<meta name="twitter:'.$k.'" content="'.$v.'">' . "\n";
}
?>