 romainG-4
|
Hello,
I am trying to:
translate custom post type on my homepage template.
with this custom loop :
<div id="slider">
<div id="diaporama">
<?php wp_reset_postdata(); ?>
<?php query_posts('posts_per_page=-1&post_type=diaporama'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" ); ?>
<li class="slide-home" style="background-image: url('<?php echo $thumbnail_src[0]; ?>')">
<div class="container slide-info">
<p class="slide-text">
<?php echo get_the_content(); ?>
</p>
</div>
</li>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
But the same language is visible in French and in English.
I'm sorry but the site i'm currently working on is in local so if it's necessary i'll create a pre-production space with the website.
Waiting for your response,
Best regards,
|
 Pierre
Supporter
Languages:
English (English )
French (Français )
Portuguese (Brazil) (Português )
Timezone:
America/Sao_Paulo (GMT-03:00)
|
Hello,
Thank you for your message!
Can you make sure you set your custom post type to "Translate" in WPML > Translation options (Custom post types section)?
Then, when you call a query to retrieve your posts types, you should add a "suppress_filters=0" parameters in the arguments, like this:
<?php query_posts('posts_per_page=-1&post_type=diaporama&suppress_filters=0'); ?>
Please have a look at our documentation: https://wpml.org/documentation/support/achieving-wpml-compatibility-for-your-themes-and-plugins/debugging-theme-compatibility/
Let me know if this helps.
Regards,
Pierre
|