The XML sitemap for posts ("post-sitemap") shows the following error:
TypeError thrown
Argument 2 passed to wp_permastructure::parse_permalinks() must be an instance of WP_Post,
instance of stdClass given
It looks like this is a conflict with the WP Permastructure plugin.
I expected the XML sitemap for posts.
Click here: https://dev.crg.world/de/post-sitemap.xml
_In case I can solve this issue myself I would be happy to get any advice._
Hi @cristopherrosenberg
I'm guessing that's trouble because Yoast SEO uses optimized query for fetching posts. You can try to replace this line in wp-permastructure.php:
public function parse_permalinks( $post_link, WP_Post $post, $leavename, $sample = false ) {
with
public function parse_permalinks( $post_link, $post, $leavename, $sample = false ) {
After this change, you need to purge sitemap cache. (try to disable/enable xml sitemaps).
Hi Sa拧a,
it worked!! :-) Thank you very much for your great support!
Thanks again,
Christopher
We are happy to see that this issue has been resolved already :)
Closing the issue
Most helpful comment
Hi @cristopherrosenberg
I'm guessing that's trouble because Yoast SEO uses optimized query for fetching posts. You can try to replace this line in
wp-permastructure.php:public function parse_permalinks( $post_link, WP_Post $post, $leavename, $sample = false ) {with
public function parse_permalinks( $post_link, $post, $leavename, $sample = false ) {After this change, you need to purge sitemap cache. (try to disable/enable xml sitemaps).