Open GoogleCodeExporter opened 9 years ago
I don't know enough about the inner workings of WPML to know why this is, but
the query for the post in Catalan is failing. So an example looks like post
1633 is spanish, and 1637 is the translation. This query seems to work:
query_posts( array(
'post__in' => array( 1633 ),
'post_type' => 'any',
'post_status' => 'publish,future',
'suppress_filters' => true,
'caller_get_posts' => true,
'posts_per_page' => -1
) );
But if you do the same query for 1637, no result. Can you verify that, or see
why it would be the case?
Original comment by dylankk...@gmail.com
on 4 Mar 2011 at 6:27
I don't understand this.
If i try with the spanish id:
GeoMashup::map(map_content=global&map_cat=72&zoom='.((isset($_GET["zoom"]))?$_GE
T["zoom"]:8 .'¢er_lat=39.60675¢er_lng=2.98142'));
I get results, but if I try with the catalan:
GeoMashup::map(map_content=global&map_cat=72&zoom='.((isset($_GET["zoom"]))?$_GE
T["zoom"]:8 .'¢er_lat=39.60675¢er_lng=2.98142'));
It gets only the points but there aren't info on the bubble.
But if I try:
<ul>
<?php
global $post;
$args = array( 'numberposts' => 15, 'offset'=> 1, 'category' => 72 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
I display all titles in the correct language and the permalink it's OK too.
Original comment by brujulab...@gmail.com
on 7 Mar 2011 at 3:13
I don't think that answers my question. Have you looked at issue 366? Maybe you
could ask another WPML user via that issue.
Original comment by dylankk...@gmail.com
on 16 Mar 2011 at 1:16
Ok, thank you I look at this
Original comment by brujulab...@gmail.com
on 31 Mar 2011 at 8:36
I think we have a workaround here, and a clue to the cause of the problem:
http://motionmill.com/3287/wpml-and-geo-mashup/
Original comment by dylankk...@gmail.com
on 19 May 2011 at 2:45
Here is a modified version of the mentioned workaround that works with custom
post types:
<?php
$object_ids = $_GET['object_ids'];
if ( !is_array( $object_ids ) )
$object_ids = split( ‘,’, $object_ids );
// extract the post type
$post_type = get_post_type($translation_ids[0]);
// Create a new instance
$query_vars = array( 'post__in' => $translation_ids,
'post_type' => $post_type,
'post_status' => 'publish' );
$second_query = new WP_Query( $query_vars );
// The Loop
...
?>
Original comment by mamoun.d...@gmail.com
on 24 Jun 2011 at 3:19
Thanks Ma'moun. Looks like that would not work if there were posts of different
types at the same location, but hopefully that's a rare case. You'd have to
make an array of post types to cover that possibility.
Original comment by dylankk...@gmail.com
on 27 Jun 2011 at 11:36
Opps, while reading your reply I noticed that there was a typo in my code,
since I actually used different variable names in my file. $translation_ids
above should be: $object_ids (so $translation_ids[0] also will be
$object_ids[0])
Original comment by mamoun.d...@gmail.com
on 28 Jun 2011 at 9:02
Original issue reported on code.google.com by
brujulab...@gmail.com
on 3 Mar 2011 at 11:37