WordPress’de Breadcrumb yapımı ( Eklentisiz )
18 Ağustos 2018 / 17:08
Burak

Merhaba arkadaşlar WordPress üzerinden eklentisiz olarak Breadcrumb yapmak isterseniz aşağıdaki kodları kullanabilirsiniz.
1 2 3 4 5 |
<ul class="single_breadcump"> <li><a href="<?php bloginfo('url'); ?>">Ana Sayfa <i class="fa fa-caret-right"></i></a> </li> <li><?php the_category(' <i class="fa fa-caret-right"></i> '); ?> </li> <li><?php the_title(' <i class="fa fa-caret-right"></i> '); ?> </li> </ul> |
Ayrıca breadcumb google schema ile uyumlu olması için single.php de aşağıdaki kodu yapıştırmanız yeterlidir
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?php // Get the ID of a given category $idd=$category[0]->cat_name; $category_id = get_cat_ID($idd); // Get the URL of this category $category_link = get_category_link( $category_id ); ?> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "Anasayfa", "item": "https://www.tesetturluelbise.com" },{ "@type": "ListItem", "position": 2, "name": "<?php echo $category[0]->cat_name; ?>", "item": "<?php echo esc_url( $category_link ); ?>" },{ "@type": "ListItem", "position": 3, "name": "<?php the_title(); ?>" }] } </script> |
Bu Yazılarıda Okuyabilirsiniz...
Bir cevap yazın