- Status
- Resolved
- Reported for
- WPML Multilingual CMS 4.4.8
- Resolved in
- 4.4.9
Overview of the issue
In some cases, posts and pages that have similar slugs may show the wrong content.
For example, if you have a post type called Books with content at http://example.com/book/title/, and you also have a post with the same slug, http://example.com/title/, you will see the wrong content when visiting these URLs.
Workaround
Our developers are working on fixing the issue.
As a workaround:
- Go to plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-404-guess.php, line 36
- Replace
public function guess_cpt_by_name( $name, $query ) { $type = $query->get( 'post_type' ); $ret = array( $name, $type, false ); - With
public function guess_cpt_by_name( $name, $query ) { $type = $query->get( 'post_type' ); if (empty($type)) { $type = !empty($query->get( 'pagename' )) ? 'page' : 'post'; } $ret = array( $name, $type, false );