Conflict with the plugin "WP Permastructure"
Please give us a description of what happened.
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.
Please describe what you expected to happen and why.
I expected the XML sitemap for posts.
How can we reproduce this behavior?
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.
Technical info
- WordPress version: 4.8.1
- Yoast SEO version: 5.3.2
- WP Permastructure version: 1.4.2
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