JEverhart383 / astro-wordpress-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Category pages not loading content

cgranier opened this issue · comments

I had an issue where category pages were not loading. So, for instance https://sitename.com/category/ would result in an empty page. The console would complain with:

[getStaticPaths] Route pattern matched, but no matching static path found. (/category/)

I added the following to the getAllUris function's query:

categories(first: 100) { nodes { uri } }

and now category pages are populating properly.

I'm reading data from my own website, which runs the Newspaper theme. Not sure if there's any relation between the theme and this issue, but if you're not getting category pages, try this.

Thanks for writing this issue. The default term query only returns ten items unless we specify another number, kind of like you did in your example. I was able to get this to work as well on a site with lots of taxonomy terms:

terms(first:100) {
      nodes {
        uri
      }
    }

I'd be interested to see if that works for you're use case as well. The benefit of using terms is that we would get categories, tags, and other custom taxonomies if they were registered. Thanks again for raising the issue. I'll update the starter to accommodate more than 10 terms by default.

I gave this a quick try, removing my category query and adding the '(first: 100)' to terms, but keep running into the same problem.

I'll run some more tests tomorrow. Let me know if you want me to try anything in particular.

Ok. I think the problem here (at least with the site I'm testing this on) is that it has over 17,000 tags defined. From what I could see going through the tags, it's either editor errors or simply a misunderstanding about how to use tags. At least we are now aware of the problem and how it affects both sides of this issue.

commented

I have multilanguage blog with more than 100 posts and have the same issue. 404 instead of post. I think the better way will be try to find post based on sług, without function to getAllUrls at start.