Recent post in Blog shows the first article

Hi! I think we have found a bug. Please see the blog: http://demo.finnguru.fi/en/a-finnish-home-with-a-travelers-eye/

When you click the Recent posts, all the posts show the article: http://demo.finnguru.fi/en/a-finnish-home-with-a-travelers-eye/
How this can be fixed?

Thank you!

Hi Anni,

Thanks for writing in! Upon checking your site, it seems that you’re experiencing a plugin conflict. Could you please try disabling your 3rd party plugins and re-test your issue further. Specially try disabling any WPML or multilingual CSM plugin.

If the issue is resolved, then you can activate your plugins one by one to see which plugin causing this issue.

Please make sure to clear all caches when testing your issue (https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress/).

Le us know how it goes.
Thanks!

Hi!

I have disabled the plug-ins. If I disable the WPML Multilingual CMS Plug-in, the page does not look the same (it combines two languages I have) and then the links are working. When I enabled it again, the problem is back. So, it need to be some how related to that.

I also noticed, then I am under one “related article” or in one article the language flag disappears also from the top navigation. In the blog main page it is there and also when I am on category main page.

So, please, I need more help with this.

Hello Anni,

Thanks for updating the thread.

As of today the supported version of WPML is 4.2.5. Please make sure that you are using the supported version of WPML. Along with that, please share the website login details in secure note for us to take closer look.

Thanks.

Hi!

I have left secure note. How I can get back to the old version? We are using 4.2.6.

Hi Anni,

I’m afraid you’ll have to contact WPML in order to get a copy of older version, and I’m not fully sure if they provides older versions. Then once downloaded, you can deactivate your existing WPML and delete it, then install your downloaded copy in Admin > Plugins > Add New > Upload Plugin.

Thanks!

Hi!

I have installed the older version of WPML, but the problem still exist. I have emptied the cache with a plug in and everything. It seems that the problem is with Cornerstone and WPML. How I should continue to work with the issue?

Hi Anni,

Sorry that you’re having that issue, this is actually a some kind of a known issue. Please follow the solution provided here.

For that, you need to have a child theme, then add the given code on the child theme’s functions.php file.

How To Setup Child Themes

Or if that did not work, please try the other solution here from WPML.

Hope it helps,
Cheers!

Hi!

I have installed the child theme. So this need to be added to the function.php as it is? Just in the beginning of the php? I am not a programmer, so need to be very sure :slight_smile:

// Fix WPML compatibility for the recent posts’ issue
add_action(‘after_setup_theme’, ‘fix_wpml_permalink_conflict’, 999);

function fix_wpml_permalink_conflict() {
if ( function_exists(‘icl_object_id’) ) {
remove_filter( ‘the_permalink’, ‘filter_permalink’ );
}
}

Hi Anni,

Once you setup your child theme, you need to add the PHP code below the following line inside functions.php file which is located under /wp-content/themes/x-child/functions.php

// Additional Functions
// =============================================================================

If that does not help, please try following this thread (https://wpml.org/forums/topic/post-links-default-to-site-root-rather-than-post-permalink-2/).

Thanks!

Hello Anni,

Looks like you have withdrawn the ticket. If you have more questions, please create a new ticket and we will be happy to assist you further.

Thanks.

Hi!

Ups, sorry about that.

The first hint did not work, but the second yes! I did this:

  • 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.

Thank you so much!

You’re welcome! :slight_smile:

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