Skip to content

Commit

Permalink
Merge pull request #99 from wokamoto/feature/support_custome_post_typ…
Browse files Browse the repository at this point in the history
…e_archive

some fix
  • Loading branch information
wokamoto authored Jul 14, 2022
2 parents d74267b + ab54d9f commit 76e56b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/WP/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . '*';
}

Expand Down

0 comments on commit 76e56b8

Please sign in to comment.