При переходе на рубрику в Wordpress вылезают ошибки, не могу разобраться
Notice: Trying to get property of non-object in /home/d/d/site.com/public_html/wp-content/themes/medical/functions.php on line 343
Notice: Trying to get property of non-object in /home/d/d/site.com/public_html/wp-content/themes/medical/functions.php on line 343
Strict Standards: Only variables should be assigned by reference in /home/d/d/site.com/public_html/wp-content/themes/medical/functions.php on line 369
Код с 343 по 370 линию
elseif( $wp_post_types[$post->post_type]->hierarchical ){
$parent = $post->post_parent;
$crumbs=array();
while($parent){
$page = &get_post($parent);
$crumbs[] = sprintf($patt, get_permalink($page->ID), $page->post_title);
$parent = $page->post_parent;
}
$crumbs = array_reverse($crumbs);
foreach ($crumbs as $crumb)
$out .= $crumb.$sep;
$out = $out . $post->post_title;
}
else // Таксономии, вложения и не древовидные типы записей
{
// Определяем термины
if(!$term){
if( is_singular() ){
if( !$taxonomies ){
$taxonomies = get_taxonomies( array('hierarchical'=>true, 'public'=>true) );
if( count($taxonomies)==1 ) $taxonomies = 'category';
}
if( $term = get_the_terms( $post->post_parent?$post->post_parent:$post->ID, $taxonomies ) )
$term = array_shift($term);
}
else
$term = &$wp_query->get_queried_object();
}