' . esc_html__('Home', 'app7') . '';
$showCurrent = 1;
global $post;
$homeLink = esc_url(home_url());
if (is_front_page()) {
return;
} // don't display breadcrumbs on the homepage (yet)
printf( '%s', $home );
if (is_category()) {
// category section
$thisCat = get_category(get_query_var('cat'), false);
if (!empty($thisCat->parent)) {
echo get_category_parents($thisCat->parent, true, ' ' . '/' . ' ');
}
echo '' . esc_html__('Archive for category', 'app7') . ' "' . single_cat_title('', false) . '"' . '';
} elseif (is_search()) {
// search section
echo '' . esc_html__('Search results for', 'app7') . ' "' . get_search_query() . '"' . '';
} elseif (is_day()) {
echo '' . get_the_time('Y') . '';
echo '' . get_the_time('F') . '';
echo '' . get_the_time('d') . '';
} elseif (is_month()) {
// monthly archive
echo '' . get_the_time('Y') . '';
echo '' . get_the_time('F') . '';
} elseif (is_year()) {
// yearly archive
echo '' . get_the_time('Y') . '';
} elseif (is_single() && !is_attachment()) {
// single post or page
if (get_post_type() != 'post') {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
echo '' . $post_type->labels->singular_name . '';
if ($showCurrent) {
echo '' . get_the_title() . '';
}
} else {
$cat = get_the_category();
if (isset($cat[0])) {
$cat = $cat[0];
} else {
$cat = false;
}
if ($cat) {
$cats = get_category_parents($cat, true, ' ' . ' ' . ' ');
} else {
$cats = false;
}
if (!$showCurrent && $cats) {
$cats = preg_replace("#^(.+)\s\s$#", "$1", $cats);
}
echo '' . $cats . '';
if ($showCurrent) {
echo '' . get_the_title() . '';
}
}
} elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {
// some other single item
$post_type = get_post_type_object(get_post_type());
if (!empty($post_type)) {
echo '' . $post_type->labels->singular_name . '';
}
} elseif (is_attachment()) {
// attachment section
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID);
if (isset($cat[0])) {
$cat = $cat[0];
} else {
$cat = false;
}
if ($cat) {
echo get_category_parents($cat, true, ' ' . ' ' . ' ');
}
echo '' . $parent->post_title . '';
if ($showCurrent) {
echo '' . get_the_title() . '';
}
} elseif (is_page() && !$post->post_parent) {
if ($showCurrent) {
echo '' . get_the_title() . '';
}
} elseif (is_page() && $post->post_parent) {
// child page
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '' . get_the_title($page->ID) . '';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
for ($i = 0; $i < count($breadcrumbs); $i++) {
printf( '%s', $breadcrumbs[$i] );
if ($i != count($breadcrumbs) - 1) {
;
}
}
if ($showCurrent) {
echo '' . get_the_title() . '';
}
} elseif (is_tag()) {
// tags archive
echo '' . esc_html__('Posts tagged', 'app7') . ' "' . single_tag_title('', false) . '"' . '';
} elseif (is_author()) {
// author archive
global $author;
$userdata = get_userdata($author);
echo '' . esc_html__('Articles posted by', 'app7') . ' ' . $userdata->display_name . '';
} elseif (is_404()) {
// 404
echo '' . esc_html__('Not Found', 'app7') . '';
} elseif (is_home()) {
if ($showCurrent) {
echo '' . wp_title('', false) . '';
}
}
if (get_query_var('paged')) {
if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
echo '(';
}
echo esc_html__('Page', 'app7') . ' ' . get_query_var('paged');
if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
echo ')';
}
}
}
}
// comments list
if(!function_exists('app7_comment_list')){
function app7_comment_list($comment, $args, $depth){
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
';
}
if(!empty($twitter)){
$output .='';
}
if(!empty($google_plus)){
$output .='';
}
if(!empty($pinterest)){
$output .='';
}
if(!empty($linkedin)){
$output .='';
}
return $output;
}
}
/**
* Kalkulate inline image
*/
if(!function_exists('app7_background_image_load')){
function app7_background_image_load(){
// Header bg
$footer_bg = get_theme_mod( 'footer_bg' );
if($footer_bg == ''){
$footer_bg = get_template_directory_uri() . '/images/bg-footer.png';
}
$custom_css = "
.footer-bg {
background-image: url($footer_bg);
}
";
wp_add_inline_style( 'app7-main-stylesheet', $custom_css );
}
}
add_action( 'wp_enqueue_scripts', 'app7_background_image_load' );