Mythemeshop MAGXP Temasının “data-vocabulary” Sorunu Nasıl Düzeltilir?

Mythemeshop MAGXP Temasının "data-vocabulary" Sorunu Nasıl Düzeltilir?

Google’un 6 Nisan 2020 tarihi itibari ile data-vocabulary.org işaretlemesini tamamen terk etmesinden sonra eski birçok web sitesi temasında schema.org için güncelleme yapmak gerekli hale geldi. WordPress Magxp teması da bunlardan birisi. Temanın güncel sürümleri 3.2.6 ve 3.2.7’de zaten gerekli düzenleme yapılmış durumda fakat daha eski temalarda halen daha data-vocabulary işaretlemesi mevcut. Fakat fazla bir yerde değil, sadece iki yerde.

Peki Bunu Nasıl Değiştiririz? 

Ya Magxp teması için güncel sürümü indirip yükleyeceksiniz (ki bunun için temayı yeni satın almış olmanız gerekiyor. Premium güncelleme hakkınız yoksa güncel sürümü indiremiyorsunuz.), yada aşağıdaki düzenlemeleri el ile yapacaksınız.

Filezilla yada Winscp ile MAGXP teması kullanılan web sitesinin themes dizinine gidin, tema klasörüne girin.

404.php dosyasını indirin, aşağıdakini bulun;

<div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php mts_the_breadcrumb(); ?></div>

Şununla değiştirin;

<div class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList"><?php mts_the_breadcrumb(); ?></div>

Aynı tema dizininde templates klasörüne girin, single-post-content.php dosyasını indirin, aşağıdakini bulun;

<div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php mts_the_breadcrumb(); ?></div>

Şununla değiştirin;

<div class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList"><?php mts_the_breadcrumb(); ?></div>

Temanın ana dizinine geri dönün, functions klasörüne girin, theme-actions.php dosyasını indirin, aşağıdakini bulun;

/*------------[ breadcrumb ]-------------*/
if (!function_exists('mts_the_breadcrumb')) {
function mts_the_breadcrumb() {
echo '<div typeof="v:Breadcrumb" class="root"><a rel="v:url" property="v:title" href="';
echo home_url();
echo '" rel="nofollow">'.sprintf( __( "Home","mythemeshop"));
echo '</a><span class="arrow"></span></div>';
if (is_category() || is_single()) {
$categories = get_the_category();
$output = '';
if($categories){
foreach($categories as $category) {
echo '<div typeof="v:Breadcrumb"><a href="'.get_category_link( $category->term_id ).'" rel="v:url" property="v:title">'.$category->cat_name.'</a><span class="arrow"></span></div>';
}
}
} elseif (is_page()) {
echo '<div typeof="v:Breadcrumb"><span property="v:title">';
the_title();
echo '</span><span class="arrow"></span></div>';
}
}
}

Ve şununla değiştirin;

/*------------[ breadcrumb ]-------------*/
if (!function_exists('mts_the_breadcrumb')) {
    function mts_the_breadcrumb() {
    	echo '<div itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="root"><a itemprop="item" href="';
        echo home_url();
        echo '" rel="nofollow" ><span itemprop="name">'.sprintf( __( "Home","mythemeshop"));
        echo '</span><meta itemprop="position" content="1" /></a><span class="arrow"></span></div>';
        if (is_category() || is_single()) {
            $categories = get_the_category();
            $output = '';
            if($categories){
                foreach($categories as $category) {
                    echo '<div itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a href="'.get_category_link( $category->term_id ).'" itemprop="item"><span itemprop="name">'.$category->cat_name.'</span><meta itemprop="position" content="2" /></a><span class="arrow"></span></div>';
                }
            }
        } elseif (is_page()) {
            echo '<div itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><span itemprop="name">';
            the_title();
            echo '</span><meta itemprop="position" content="2" /><span class="arrow"></span></div>';
        }
    }
}

Hepsi bu. Artık temanızda eski artık data-vocabulary.org işaretlemesi kalmadı. Aynı şeyi diğer temalar içinde benzer şekilde ve schema.org’dan yardım alarak yapabilirsiniz. Konuyla alakalı sorularınızı konu altından yorum olarak yazabilirsiniz.