diff --git a/classes/WP/Post.php b/classes/WP/Post.php index b4403c0c..9b8f4655 100644 --- a/classes/WP/Post.php +++ b/classes/WP/Post.php @@ -104,10 +104,13 @@ public function get_the_post_type_archive_links() { } $post = $this->post; $url = $this->parse_url( get_post_type_archive_link( $post->post_type ) ); + if ( is_wp_error( $url ) ) { + $url = false; + } $home_url = $this->parse_url( home_url() ); $links = array(); - if ( trailingslashit( $home_url ) !== $url ) { + if ( $url && trailingslashit( $home_url ) !== $url ) { $links[] = $url . '*'; }