Recent Posts widget link compatibility issue between Cornerstone and WPML (fixed)

Recently I’ve bumped into a known issue that’s been causing many users annoyance in the support forum: Links for posts in the the WordPress default ‘Recent Posts’-widget all default to the same URL (usually site address URL) when users are running the WPML multilingual plugin with their X/Pro site.

Some encountered this problem with X, some with Pro, but in the end, the root cause lies with an issue between Cornerstone and WPML. I’ve worked with WPML to resolve the issue and would like to share it with anyone searching the forums:

Please follow this steps in order to solve the issue:

  • Edit the file wp-content/plugins/cornerstone/includes/classes/components/class-wpml.php
  • Disable this line:
    add_filter( 'the_permalink', array( $this, 'filter_permalink' ) );
  • Save the changes.

Furthermore, I’d like to request a fix from Themeco devs working on Cornerstone to investigate the source of the incompatibility and look if there’s a fix to be made. Perhaps (for now) commenting out that line of code in the next Cornerstone update?

Thanks and good luck :slight_smile:

Hi @skndal,

Thanks for reaching out.

I just tried it on my installation and I don’t see any issue with my widget URLs. Or maybe it’s happening because the post variable is empty in your case and it uses the last working/valid variable to display it.

Maybe I know what version of WPML you’re using? I’ll gather some information and add this to our issue tracker.

Thanks.

Hi @Rad! Might I suggest you guys collab with the compatibility team at WPML to reproduce and resolve the issue? They have access to a copy of the install and have succesfully reproduced the problem as well. The support thread over there is: https://wpml.org/forums/topic/post-links-default-to-site-root-rather-than-post-permalink-2/ – Best of luck! :slight_smile:

Hello @skndal,

Thanks for updating the thread.

I will record the message into our issue tracker so that our developers can be made aware of.

Thanks for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.