Skip to content

Instantly share code, notes, and snippets.

@Dziuperman
Created July 19, 2019 09:38
Show Gist options
  • Save Dziuperman/ca8b745ad420a7e6c5b6956df278f463 to your computer and use it in GitHub Desktop.
Save Dziuperman/ca8b745ad420a7e6c5b6956df278f463 to your computer and use it in GitHub Desktop.
add_action('kama_breadcrumbs_home_after', 'my_breadcrumbs_home_after', 10, 4);
function my_breadcrumbs_home_after( $false, $linkpatt, $sep, $ptype ){
// если мы в рубрике с ID 5 или в дочерней рубрике,
// то дополним начало крошек ссылкой на страницу с ID 7
$mec_category = get_queried_object();
if( is_archive() && ( $mec_category->taxonomy == 'mec_category' ) ){
$category = get_queried_object();
$mec_category->name;
if($category->name == $mec_category->name) {
$category_id = $category->term_id;
return sprintf( $linkpatt, get_category_link(get_cat_ID($category->name)), $category->name ) . $sep;
}
}
return $false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment