mirror of
https://github.com/danpros/htmly.git
synced 2026-04-17 19:26:08 +05:30
Update functions.php
This commit is contained in:
parent
9c5b7a757a
commit
c26c33095e
1 changed files with 11 additions and 4 deletions
|
|
@ -3777,6 +3777,7 @@ function generate_meta($type = null, $object = null)
|
|||
if (empty($defaultImg)) {
|
||||
$defaultImg = site_url() . 'system/resources/images/logo-big.png';
|
||||
}
|
||||
$fbApp = config('fb.appid');
|
||||
$facebook = config('social.facebook');
|
||||
$twitter = config('social.twitter');
|
||||
if (is_null($object)) {
|
||||
|
|
@ -3796,6 +3797,9 @@ function generate_meta($type = null, $object = null)
|
|||
$twitter = parse_url($twitter);
|
||||
$tags .= '<meta name="twitter:site" content="'. str_replace('/', '@', $twitter['path']) .'" />' . "\n";
|
||||
}
|
||||
if (!empty($fbApp)) {
|
||||
$tags .= '<meta property="fb:app_id" content="'. $fbApp .'" />' . "\n";
|
||||
}
|
||||
} else {
|
||||
if(!empty($object->image)) {
|
||||
$image = $object->image;
|
||||
|
|
@ -3820,7 +3824,7 @@ function generate_meta($type = null, $object = null)
|
|||
$tags .= '<meta name="article:modified_time" content="'. date('c', $object->lastMod) .'" />' . "\n";
|
||||
}
|
||||
if(!empty($facebook)) {
|
||||
$tags .= ' <meta property="article:publisher" content="'. $facebook .'" />' . "\n";
|
||||
$tags .= '<meta property="article:publisher" content="'. $facebook .'" />' . "\n";
|
||||
}
|
||||
if(!empty($twitter)) {
|
||||
$twitter = parse_url($twitter);
|
||||
|
|
@ -3831,6 +3835,9 @@ function generate_meta($type = null, $object = null)
|
|||
$tags .= '<meta property="og:description" content="'. $object->description .'" />' . "\n";
|
||||
$tags .= '<meta name="twitter:card" content="summary_large_image" />' . "\n";
|
||||
$tags .= '<meta property="og:image" content="'. $image .'" />' . "\n";
|
||||
if (!empty($fbApp)) {
|
||||
$tags .= '<meta property="fb:app_id" content="'. $fbApp .'" />' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $tags;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue