is_post_type_archive gets confused with dash?
-
I have the code below in my theme functions file. It seems both post types gets the the same title set in functions (whichever that comes first, the second is ignored). It seems post_type_archive thinks they are the same because both starts with tv- ? Any workaround other than renaming posttype removing the dash?
elseif (is_post_type_archive(tv-pakker)) { ?> <h1 class="archive-title"> <?php $titles = get_option( 'wpseo_titles' ); $title = $titles['title-ptarchive-tv-pakker']; echo apply_filters( 'the_title', $title ); ?> </h1> <?php } elseif (is_post_type_archive(tv-streaming)) { ?> <h1 class="archive-title"> <?php $titles = get_option( 'wpseo_titles' ); $title = $titles['title-ptarchive-tv-streaming']; echo apply_filters( 'the_title', $title ); ?> </h1>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘is_post_type_archive gets confused with dash?’ is closed to new replies.