/** * Print SEO meta tags * @return void */ function _metaSeoTags() { if (_meta('description')) { _cfg('metaDescription', _meta('description')); } if (_meta('keywords')) { _cfg('metaKeywords', _meta('keywords')); } $gpSiteName = _cfg('siteName'); if (_meta('gp:name')) { $gpSiteName = _meta('gp:name'); } if (_meta('gp:site_name')) { $gpSiteName = _meta('gp:site_name'); } $tags = array(); $tags['description'] = _cfg('metaDescription'); $tags['keywords'] = _cfg('metaKeywords'); $tags['og'] = array(); $tags['og']['title'] = _meta('og:title') ? _meta('og:title') : _cfg('siteName'); $tags['og']['url'] = _meta('og:url') ? _meta('og:url') : _url(); $tags['og']['type'] = _meta('og:type') ? _meta('og:type') : 'website'; $tags['og']['image'] = _meta('og:image') ? _meta('og:image') : _img('logo-200x200.jpg'); $tags['og']['description'] = _meta('og:description') ? _meta('og:description') : _cfg('metaDescription'); $tags['og']['site_name'] = _meta('og:site_name') ? _meta('og:site_name') : _cfg('siteName'); $tags['twitter'] = array(); $tags['twitter']['card'] = _meta('twitter:card') ? _meta('twitter:card') : 'summary'; $tags['twitter']['site'] = _meta('twitter:site') ? '@' . _meta('twitter:site') : '@' . _cfg('siteDomain'); $tags['twitter']['title'] = _meta('twitter:title') ? _meta('twitter:title') : _cfg('siteName'); $tags['twitter']['description'] = _meta('twitter:description') ? _meta('twitter:description') : _cfg('metaDescription'); $tags['twitter']['image'] = _meta('twitter:image') ? _meta('twitter:image') : _img('logo-120x120.jpg'); $tags['gp'] = array(); $tags['gp']['name'] = $gpSiteName; $tags['gp']['description'] = _meta('gp:description') ? _meta('gp:description') : _cfg('metaDescription'); $tags['gp']['image'] = _meta('gp:image') ? _meta('gp:image') : _img('logo-200x200.jpg'); if (function_exists('__metaSeoTags')) { echo __metaSeoTags($tags); } else { echo "\n"; foreach ($tags as $name => $tag) { if ($name == 'og') { foreach ($tag as $key => $content) { echo '<meta property="og:' . $key . '" content="' . $content . '" />' . "\n"; } } elseif ($name == 'twitter') { foreach ($tag as $key => $content) { echo '<meta name="twitter:' . $key . '" content="' . $content . '" />' . "\n"; } } elseif ($name == 'gp') { foreach ($tag as $key => $content) { echo '<meta itemprop="' . $key . '" content="' . $content . '" />' . "\n"; } } else { echo '<meta name="' . $name . '" content="' . $tag . '" />' . "\n"; } } } }
<?php /** * The index.php (required) serves as the front controller for the requested page, * initializing the base resources needed to run the page */ $pageTitle = _t('Blog') . ' (' . _t('AJAX List & Pagination') . ')'; _meta('description', $pageTitle . ': ' . _cfg('metaDescription')); ?> <!DOCTYPE html> <html> <head> <title><?php echo _title($pageTitle); ?> </title> <?php include _i('inc/tpl/head.php'); ?> </head> <body> <?php include 'view.php'; ?> </body> </html> <script type="text/javascript"> $(function() { LC.Page.Blog.init(); }); </script>