Skip Navigation

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

Last updated by Amir 9 years, 5 months ago.

Author Posts
March 4, 2011 at 6:38 pm #22956

Patrick

Is there a better way than this to get a specific post to display on my mostly static homepage?

<?php
	// TODO: Better way?
	(ICL_LANGUAGE_CODE == 'fr') ? $id = 154 : $id = 158;
	$text = get_post($id);
?>

Thanks

March 4, 2011 at 8:19 pm #22958

Amir
Supporter

You can use the function

icl_object_id

, it's intended exactly for this:
http://wpml.org/documentation/support/creating-multilingual-wordpress-themes/language-dependent-ids/

The topic ‘[Closed] Get a specific post, better way than this?’ is closed to new replies.