| | |
| | | $registrar = Registrar::getInstance($type); |
| | | if ($registrar && !empty($registrar->getConfig('seo')['schema']??[])) { |
| | | $seo = $registrar->getSEO(); |
| | | error_log('SEO: '.print_r($seo->schema(), true)); |
| | | $schema[] = $seo->schema()->outputArchiveSchema(); |
| | | } |
| | | } |
| | | $isContent = array_values(array_filter(array_map(function($item) { |
| | | return intval(get_option(BASE.$item.'_archive', false)); |
| | | },Registrar::getFeatured('is_content', 'term')))); |
| | | |
| | | if (is_page($isContent)){ |
| | | $type = get_post_meta(get_the_id(), BASE.'for_type', true); |
| | | error_log('Type: '.print_r($type, true)); |
| | | $registrar = Registrar::getInstance($type); |
| | | if ($registrar) { |
| | | $schema[] = $registrar->getSEO()->schema()->outputContentTaxArchiveSchema(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | $breadcrumbs = $this->buildBreadcrumbs(); |
| | | if ($breadcrumbs) { |
| | |
| | | if (!empty($schema)) { |
| | | $website = get_option(BASE.'WebsiteSchema'); |
| | | if (!empty($website)) { |
| | | if (JVB_TESTING) { |
| | | Cache::for('websiteSchema')->flush(); |
| | | } |
| | | $website = Cache::for('websiteSchema')->remember( |
| | | 'schema', |
| | | function () { |
| | |
| | | echo '<script type="application/ld+json">' . "\n"; |
| | | echo wp_json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); |
| | | echo "\n" . '</script>' . "\n"; |
| | | echo "\n" . '<!-- / SEO Schema by JakeVan -->'."\n"; |
| | | } |
| | | |
| | | public function buildBreadcrumbs():array |
| | |
| | | } |
| | | |
| | | public function buildBasicWebsiteSchema():array |
| | | { Cache::for('websiteSchema')->flush(); |
| | | { |
| | | if (JVB_TESTING){ |
| | | Cache::for('websiteSchema')->flush(); |
| | | } |
| | | |
| | | return Cache::for('websiteSchema')->remember( |
| | | 'reference', |
| | | function () { |
| | |
| | | |
| | | public function getCreator(bool $reference = false):LocalBusiness |
| | | { |
| | | if (JVB_TESTING){ |
| | | Cache::for('JakeVanCreator')->flush(); |
| | | } |
| | | |
| | | if ($reference) { |
| | | return Cache::for('JakeVanCreator')->remember( |
| | | 'reference', |