This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 12 replies, has 9 voices.

Last updated by maddalenaF-2 5 years, 5 months ago.

Assigned support staff: Amit.

Author Posts
November 21, 2013 at 11:52 am #295933


Hi there,

I'm using the WPML plugin and the GEO Mashup plugin. I know that it is a common problem that the GEO Mashup plugin stops working when the WPML plugin is enabled. I only need the GEO Mashup plugin on one language version of the website and only on a single page.

Currently i'm getting this error:

Fatal error: Call to a member function is_attachment() on a non-object in ../wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4015

Is there a workaround for this? For example removing all WPML plugin calls on one page only?

Thanks in advance!

November 21, 2013 at 2:05 pm #296011


Languages: English (English ) Russian (Русский )

Timezone: Europe/Kiev (GMT+03:00)


Thank you for contacting to us !

Could you provide us what WPML and WPML addons versions you are using ?


November 22, 2013 at 1:51 pm #296613


Languages: English (English ) Russian (Русский )

Timezone: Europe/Kiev (GMT+03:00)


Do you use any code to remove WPML function ?


November 26, 2013 at 8:05 am #297943



I haven't used any code to remove WPML function. I was wondering if it was possible to deny all WPML scripts on one single page. Because the GEO Mashup Plugin works without WPML. Do you know if that is possible to do so?

November 26, 2013 at 10:41 am #298060



Andrey is away for a few days and have asked me to take over here, hope that's fine.

Thant's a very interesting question.

I am not 100% sure, but maybe you can try this -

Or this - hidden link

If one of these works please let me know.


November 27, 2013 at 1:39 pm #298819


We've got the same problem, though need maps and WPML both working on the same pages so disabling one or the other on certain pages is not an option. I saw on another thread that you were looking to work with Geo Mashup developers to find a solution. Any idea how long that's likely to take?

Or can you recommend another mapping plugin that can replace Geo Mashup and does work with WPML? We have geolocated posts and need to display their locations on maps at the top of category pages and search pages and on single post pages - pretty standard stuff, but the sites are multilingual.

November 28, 2013 at 10:20 am #299233



my solution to solve this problem.

Edit sitepress.class.php.

Remove $query->is_attachment() at lines 4014 and 4124.

Now it's working for me.

Hope it helps.

November 28, 2013 at 4:20 pm #299493


Thanks Benjamin! Your solution worked for me.

@mattc-2 I also tried WordPress store locator, this worked for me.. but this plugin doesn't have a search widget and therefore I needed Geo Mashup to work for me.

Thanks to all for your help!

November 29, 2013 at 3:14 pm #300053


Hi Benjamin

Thanks, just seen your reply. I put in an || !is_object($query) into those two lines and that works too.

December 10, 2013 at 9:48 am #304865


Can you add that to the next release?

January 14, 2014 at 2:32 pm #321061


Chiming in here because Benjamin's solution didn't work for me. Does anyone else have any ideas?

Editing to add: Just want to mention that the map works fine in the site's primary language (English, in this case), but doesn't work on the other two languages. I get this error:

 Fatal error: Call to a member function is_attachment() on a non-object in /home/caritas/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4014
January 23, 2014 at 8:47 am #326277


Thanks Benjamin! It worked for me!

May 18, 2014 at 9:06 pm #402488


I was not happy with deleting the line as Bemjamin suggest, as I need to maintain the patch after actualization. So I worked on another solution creating new classes for
SitePress -> WMPL
GeoMashup -> Geomashup
GeoMashupDB -> Geomashup

You can find the whole code here ( in spanish with english commented code)

hidden link