Hi, Amit here, I am the WPML Support Manager, our current ticket queue is quite calm and I'd like to encourage you to use our new chat support option

We are working hard to debug and look at every single report

All of the known issues are documented in https://wpml.org/known-issues/ you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

We are also adding once a week a tutorial to our YouTube channel - https://www.youtube.com/c/WPML-multilingual - check out if we already covered what you need and leave us a comment if you want us to produce anything there

If you do need to open a ticket please make sure to provide us with all the needed information as described here https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/

We are very proud at our level of support, we are one team from all over the world and we are all experienced WordPress developers, you can read more about us here - https://wpml.org/forums/supporters/

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 Pierre 3 years, 9 months ago.

Assigned support staff: Pierre.

Author Posts
April 22, 2015 at 1:29 pm #604082

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,

April 23, 2015 at 1:36 pm #604866

Pierre
Supporter

Languages: English (English ) French (Français ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-02: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

The topic ‘[Closed] Custom post type translation problem in custom loop’ is closed to new replies.