Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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 7 replies, has 2 voices.

Last updated by Dat Hoang 5 years, 4 months ago.

Assigned support staff: Dat Hoang.

Author Posts
October 2, 2014 at 3:47 pm #484791

Dimitri

Hi,

is this function correct?

$url_azienda = get_blog_permalink( 1, icl_object_id(9, 'page', true) );

Actually doesn't work on my wordpress network installation. If I "call" a page from a specific blog I got always the page in the default language. It's like the icl_object_id does't generate the right translated ID.

October 3, 2014 at 8:06 am #485140

Dat Hoang

#1,
You are generating a permalink for blog_id = 1, right?
Where do you run this line? It's in blog_id=1 or elsewhere?

#2,
Please go to WPML > Support > Debug Information and give me the information in the next reply. You can read the detailed instruction here: http://wpml.org/faq/provide-debug-information-faster-support/

October 3, 2014 at 9:37 am #485251

Dimitri

Hi,

I generated it into the footer.php of a parent theme that is common for all the blogs.

D.

October 3, 2014 at 11:33 am #485359

Dat Hoang

#1,
No, I don't mean that.
I mean, your network has some blogs:
+ blog_id = 0
+ blog_id = 1
+ blog_id = 2
+ and etc

You are generating a permalink in a blog_id = 1, but where do you run this code and get the problem?
The problem happens on blog_id = 1 or which blog?

I'm testing with my site and let's see.

#2,
That's strange. Your debug information does not have plugins information.

October 3, 2014 at 4:08 pm #485602

Dimitri

I generate the permalink on the blog 1, but I experience the problem on the "sub-blogs" when I'm into a translated version.

D.

October 6, 2014 at 7:49 am #486347

Dat Hoang

Please try this. Does that help?

//change to blog 1
switch_to_blog( 1 );

//get the translated page id of page_id=25
$id = icl_object_id(25, 'page', true); 

//restore the sub-site
restore_current_blog();

$url_azienda = get_blog_permalink( 1, $id);
 
October 6, 2014 at 7:57 am #486355

Dimitri

Hi,

I'll try it out and I let you know.

Regards

Dimtri

October 6, 2014 at 10:59 am #486512

Dat Hoang

OK. Update me when you finish the test 🙂

The topic ‘[Closed] Wmpl with WordPress Network’ is closed to new replies.