File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/navigasyon.php.tar
var/www/vhosts/uyarreklam.com.tr/httpdocs/wp-content/themes/vadimarketv4/inc/navigasyon.php 0000644 00000013431 15154220537 0026345 0 ustar 00 <?php
if ( ! function_exists( 'temavadisi_navigasyon' ) ) :
function temavadisi_navigasyon() {
$seperator = '<span class="seperator"> ›› </span>';
$anasayfa = __( 'Anasayfa', 'temavadisi' );
$anabaslik = get_bloginfo('name');
$onek = '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name"><meta itemprop="position" content="3" />';
$sonek = '</span></li>';
if ( ! is_home() && ! is_front_page() || is_paged() ) {
echo '<div class="navi"><ol itemscope itemtype="http://schema.org/BreadcrumbList">';
global $post;
$anasayfaURL = home_url();
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" title="'.$anabaslik.'" href="' . $anasayfaURL . '"><span itemprop="name">' . $anasayfa . '</span></a><meta itemprop="position" content="1" /></li> ' . $seperator . ' ';
if ( is_category() ) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ( $thisCat->parent != 0 )
echo( get_category_parents( $parentCat, TRUE, ' ' . $seperator . ' ' ) );
printf('%1$s%2$s%3$s', $onek, single_cat_title( '', false ), $sonek );
}
elseif ( is_day() ) {
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . get_year_link( get_the_time( 'Y' ) ) . '"><span itemprop="name">' . get_the_time( 'Y' ) . '</span></a><meta itemprop="position" content="2" /></li> ' . $seperator . ' ';
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) . '"><span itemprop="name">' . get_the_time( 'F' ) . '</span></a><meta itemprop="position" content="2" /></li> ' . $seperator . ' ';
echo $onek . get_the_time( 'd' ) . $sonek;
}
elseif ( is_month() ) {
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . get_year_link( get_the_time( 'Y' ) ) . '"><span itemprop="name">' . get_the_time( 'Y' ) . '</span></a><meta itemprop="position" content="2" /></li> ' . $seperator . ' ';
echo $onek . get_the_time( 'F' ) . $sonek;
}
elseif ( is_year() ) {
echo $onek . get_the_time( 'Y' ) . $sonek;
}
elseif ( is_single() && ! is_attachment() ) {
if ( get_post_type() != 'post' ) {
$post_type = get_post_type_object( get_post_type() );
$slug = $post_type->rewrite;
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . $anasayfaURL . '/' . $slug['slug'] . '/"><span itemprop="name">' . $post_type->labels->singular_name . '</span></a><meta itemprop="position" content="2" /></li> ' . $seperator . ' ';
echo $onek . get_the_title() . $sonek;
}
else {
$cat = get_the_category(); $cat = $cat[0];
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="'.get_category_link($cat->term_id ).'"><span itemprop="name">'.$cat->cat_name.'</span></a><meta itemprop="position" content="2" /></li> ' . $seperator . ' ';
echo $onek . get_the_title() . $sonek;
}
}
elseif ( ! is_single() && ! is_page() && get_post_type() != 'post' && ! is_404() && ! is_search() ) {
$post_type = get_post_type_object( get_post_type() );
echo $onek . $post_type->labels->singular_name . $sonek;
}
elseif ( is_attachment() ) {
$parent = get_post( $post->post_parent );
$cat = get_the_category( $parent->ID );
if ( $cat ) {
$cat = $cat[0];
echo get_category_parents( $cat, TRUE, ' ' . $seperator . ' ' );
}
echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . get_permalink($parent) . '"><span itemprop="name">' . $parent->post_title . '</span></a><meta itemprop="position" content="3" /></li> ' . $seperator . ' ';
echo $onek . get_the_title() . $sonek;
}
elseif ( is_page() && ! $post->post_parent ) {
echo $onek . get_the_title() . $sonek;
}
elseif ( is_page() && $post->post_parent ) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ( $parent_id ) {
$page = get_page( $parent_id );
$breadcrumbs[] = '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . get_permalink( $page->ID ) . '"><span itemprop="name">' . get_the_title( $page->ID ) . '</span></a><meta itemprop="position" content="3" /></li>';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse( $breadcrumbs );
foreach ( $breadcrumbs as $crumb )
echo $crumb . ' ' . $seperator . ' ';
echo $onek . get_the_title() . $sonek;
}
elseif ( is_search() ) {
$sonuclari = get_search_query().' için arama sonuçları';
printf( '%1$s%2$s%3$s', $onek, $sonuclari, $sonek );
}
elseif ( is_tag() ) {
printf('%1$s%2$s%3$s', $onek, single_tag_title( '', false ), $sonek );
}
elseif ( is_author() ) {
global $author;
$userdata = get_userdata( $author );
printf('%1$s%2$s%3$s', $onek, $userdata->display_name, $sonek );
}
elseif ( is_404() ) {
printf('%1$sHata 404%2$s', $onek, $sonek );
}
if ( get_query_var( 'paged' ) ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
echo __( 'Sayfa', 'temavadisi' ) . ' ' . get_query_var( 'paged' );
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
}
echo '</ol></div>';
}
}
endif; ?>