Title: [Plugin: WordPress SEO by Yoast] error notices
Last modified: August 20, 2016

---

# [Plugin: WordPress SEO by Yoast] error notices

 *  [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-error-notices/)
 * error notice in breadcrumbs:
 * Notice: Trying to get property of non-object in /var/www/vhosts/money.cz/httpdocs/
   wp-content/plugins/wordpress-seo/frontend/class-breadcrumbs.php on line 248
 * again you should not use menu_name for frontend name, so it should be $post_type_obj-
   >labels->name
 * But in my case – ([http://money.mediacentrum.cz/reference/?kraj=jihocesky-kraj&produkt=money-s5&branze=it-a-elektronika](http://money.mediacentrum.cz/reference/?kraj=jihocesky-kraj&produkt=money-s5&branze=it-a-elektronika))–
   it is combination of custom post type and taxonomy with zero results and in this
   case $link[‘ptarchive’] is FALSE so $post_type_obj = get_post_type_object( $link[‘
   ptarchive’] ); is false as well so it throws the error above
 * [http://wordpress.org/extend/plugins/wordpress-seo/](http://wordpress.org/extend/plugins/wordpress-seo/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-error-notices/#post-2870659)
 * so the problem is on line 125
 * `$links[] = array( 'ptarchive' => get_post_type() );`
 * but the problem is, that when there is zero posts, the get_post_type returns 
   false, as global $post returns false;
 * so imo it should return probably 404 or even better – there should be a special
   breacrumb for zero results archive pages ($post = NULL), and it’s check should
   be first.
 *  Thread Starter [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-error-notices/#post-2870777)
 * i have done a workaround using filter
 *     ```
       add_filter( 'wpseo_breadcrumb_links', 'mc_breadcrumb_filter' );
       function mc_breadcrumb_filter ($links) {
   
         foreach ($links as $key => &$link) {
                 /* ... my other filters */
   
                 if (isset($link['ptarchive']) &&  $link['ptarchive']==false) {
                   global $wp_query;
                   $link['ptarchive'] = $wp_query->query_vars['post_type'];
                 }
         }
   
         return (array_values($links));
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: WordPress SEO by Yoast] error notices’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

## Tags

 * [error notice](https://wordpress.org/support/topic-tag/error-notice/)

 * 2 replies
 * 1 participant
 * Last reply from: [thomask](https://wordpress.org/support/users/thomask/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-error-notices/#post-2870777)
 * Status: not resolved