Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 1402d08

Browse files
committed
Fix tax handling for hierarchical terms
1 parent d5fa0e5 commit 1402d08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/wordpress/_global/getPostTypeStaticProps.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ export default async function getPostTypeStaticProps(
8181
Object.keys(archiveQuerySeo).includes(postType) &&
8282
params.slug.length > 1
8383
) {
84-
const taxonomy = params.slug.shift()
85-
const taxonomySlug = params.slug.join('/')
84+
const taxonomy = params.slug.shift() // First "slug" piece is taxonomy type.
85+
const taxonomySlug = params.slug.pop() // Last "slug" piece is the lowest-level taxonomy term slug.
8686

8787
const {apolloClient, ...archiveData} = await getPostTypeTaxonomyArchive(
8888
taxonomy,

0 commit comments

Comments
 (0)