seo结构化数据
在</head>之前添加以下代码
- <!-- ===== JSON-LD 结构化数据(已修复 images 数组问题) ===== -->
- <!-- 1. LocalBusiness(全站) -->
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "LocalBusiness",
- "name": "LED显示屏批发",
- "url": "https://www.dzping.com/",
- "logo": "{{$home_site_logo}}",
- "image": "{{$home_site_logo}}",
- "description": "LED屏伙伴线上查价系统,定位为LED显示屏行业的综合服务入口,旨在解决led大屏采购、选型及售后维修,提供LED显示屏价格查询、规格书下载、供应链资源对接等全方位一站式服务。",
- "telephone": "027-89992224",
- "address": {
- "@type": "PostalAddress",
- "streetAddress": "洪山区白沙洲大道华中城15栋4楼",
- "addressLocality": "武汉市",
- "addressRegion": "湖北省",
- "postalCode": "430071",
- "addressCountry": "CN"
- },
- "knowsAbout": "LED显示屏制造与批发销售",
- "contactPoint": {
- "@type": "ContactPoint",
- "telephone": "133 4343 9696",
- "contactType": "customer service",
- "availableLanguage": "Chinese"
- }
- }
- </script>
- <!-- 2. WebSite(全站) -->
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "WebSite",
- "name": "{{$home_site_name}}",
- "url": "{{$home_url}}"
- }
- </script>
- <!-- 3. BreadcrumbList(有面包屑数据时输出) -->
- {{if !empty($breadcrumb_data) && is_array($breadcrumb_data)}}
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "BreadcrumbList",
- "itemListElement": [
- {{foreach $breadcrumb_data as $k=>$v}}
- {{if $k > 0}},{{/if}}
- {
- "@type": "ListItem",
- "position": {{:$k+1}},
- "name": "{{$v.name}}",
- "item": "{{:isset($v['url']) && !empty($v['url']) ? $v['url'] : $my_view_url}}"
- }
- {{/foreach}}
- ]
- }
- </script>
- {{/if}}
- <!-- 4. Product(商品详情页) -->
- {{if !empty($goods) && is_array($goods)}}
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "Product",
- "name": "{{$goods.title}}",
- "description": "{{if !empty($goods.simple_desc)}}{{$goods.simple_desc}}{{else /}}{{$home_seo_site_description}}{{/if}}",
- {{if !empty($goods.model)}}
- "sku": "{{$goods.model}}",
- {{/if}}
- "image": "{{:!empty($goods['images']) ? (is_array($goods['images']) ? $goods['images'][0] : $goods['images']) : $home_site_logo}}",
- {{if !empty($goods.brand_name)}}
- "brand": {
- "@type": "Brand",
- "name": "{{$goods.brand_name}}"
- },
- {{/if}}
- "offers": {
- "@type": "Offer",
- "url": "{{$my_view_url}}",
- "priceCurrency": "CNY",
- {{if !empty($goods.price) && is_numeric($goods.price)}}
- "price": "{{$goods.price}}",
- {{/if}}
- "availability": "{{if !empty($goods.inventory) && $goods.inventory > 0}}https://schema.org/InStock{{else /}}https://schema.org/OutOfStock{{/if}}"
- }
- }
- </script>
- {{/if}}
- <!-- 5. Article(文章页) -->
- {{if !empty($article) && is_array($article) && !empty($article.title)}}
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "Article",
- "headline": "{{$article.title}}",
- "description": "{{if !empty($article.simple_desc)}}{{$article.simple_desc}}{{elseif !empty($article.seo_desc)}}{{$article.seo_desc}}{{else /}}{{$home_seo_site_description}}{{/if}}",
- {{if !empty($article.add_time)}}
- "datePublished": "{{:date('c', strtotime($article.add_time))}}",
- {{/if}}
- {{if !empty($article.upd_time)}}
- "dateModified": "{{:date('c', strtotime($article.upd_time))}}",
- {{elseif !empty($article.add_time) /}}
- "dateModified": "{{:date('c', strtotime($article.add_time))}}",
- {{/if}}
- "image": "{{:!empty($article['images']) ? (is_array($article['images']) ? $article['images'][0] : $article['images']) : $home_site_logo}}",
- "author": {
- "@type": "Organization",
- "name": "LED显示屏批发",
- "url": "https://www.dzping.com/"
- },
- "publisher": {
- "@type": "Organization",
- "name": "LED显示屏批发",
- "logo": {
- "@type": "ImageObject",
- "url": "{{$home_site_logo}}"
- }
- },
- "mainEntityOfPage": {
- "@type": "WebPage",
- "@id": "{{$my_view_url}}"
- }
- }
- </script>
- {{/if}}
- <!-- 6. BlogPosting(博客详情页) -->
- {{if !empty($data) && is_array($data) && !empty($data.title)}}
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "BlogPosting",
- "headline": "{{$data.title}}",
- "description": "{{if !empty($data.simple_desc)}}{{$data.simple_desc}}{{elseif !empty($data.seo_desc)}}{{$data.seo_desc}}{{else /}}{{$home_seo_site_description}}{{/if}}",
- {{if !empty($data.add_time)}}
- "datePublished": "{{:date('c', strtotime($data.add_time))}}",
- {{/if}}
- {{if !empty($data.upd_time)}}
- "dateModified": "{{:date('c', strtotime($data.upd_time))}}",
- {{elseif !empty($data.add_time) /}}
- "dateModified": "{{:date('c', strtotime($data.add_time))}}",
- {{/if}}
- "image": "{{:!empty($data['images']) ? (is_array($data['images']) ? $data['images'][0] : $data['images']) : $home_site_logo}}",
- "author": {
- "@type": "Organization",
- "name": "LED显示屏批发",
- "url": "https://www.dzping.com/"
- },
- "publisher": {
- "@type": "Organization",
- "name": "LED显示屏批发",
- "logo": {
- "@type": "ImageObject",
- "url": "{{$home_site_logo}}"
- }
- },
- "mainEntityOfPage": {
- "@type": "WebPage",
- "@id": "{{$my_view_url}}"
- }
- }
- </script>
- {{/if}}
复制代码
|
|