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

Last updated by Vinicio 7 years ago.

Assigned support staff: sarah.n.

Author Posts
October 2, 2012 at 8:38 am #77881

Vinicio

We've updated WPML to version 2.6 and we have big problems with our websites because articles are shown doubled in the frontend. We've tried deactivating WPML and everything is OK.
You can see the problem here: hidden link
and here: hidden link
We're using WordPress 3.4.2.
Thank you in advance for your help!

October 2, 2012 at 8:59 am #77885

Pierre

I have exactly the same problem, and have tested all plugins and themes: the problem is WPML.

Example: any post of hidden link

October 2, 2012 at 9:08 am #77887

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Hello Vinicio, Pierre,

In both cases we need to take look at the code (NOT page source code but template php code!) that outputs the content on the pages that have the duplicate content issue.

May I ask both of you please to copy and paste the single.php code?

Vinicio, you will also need to copy and paste the code that outputs the front page content.

P.S Please make sure that you use the latest version of everything; WordPress WPML and add-ons and of your theme!

October 2, 2012 at 9:31 am #77898

Vinicio

This is the index.php: http://pastebin.com/0PY8pbG8

And this one is the single.php: http://pastebin.com/nxHWpwSk

Everything is updated to the latest version.

October 2, 2012 at 9:52 am #77905

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Vinicio,

Thank you for this.

I will first address the single.php template. Please make a back-up of your file first before you make the following edits.

Delete or comment out lines 10 & 11 with the following:

 <?php if ( have_posts() ) : $count = 0; ?>
 <?php while ( have_posts() ) : the_post(); $count++; ?>

Delete or comment out lines 91 -96 with the following:

<?php endwhile; else: ?>
<div class="post not-found">
<h2 class="title"><?php _e( 'Error 404 - Page not found!', 'woothemes' ); ?></h2>
<p><?php _e( 'The page you trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.', 'woothemes' ); ?></p>
</div><!-- /.post -->
<?php endif; ?>

Upload the modified single.php and let me know if that makes a differense.

October 2, 2012 at 9:58 am #77907

Vinicio

Yes, it works!

Thank you

October 2, 2012 at 10:01 am #77909

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

OK this is good news 🙂

Now for the front page. Looking at the page source code could it be that the template used is the page.php rather than the index.php?

If you are using a static front page then WordPress will send page.php to the browser. Is this the case with you? If so, could you please provide the page.php code in pastebin?

Thanks!

October 2, 2012 at 10:08 am #77910

Vinicio

Here there's page.php: http://pastebin.com/2btHqRvQ

Thanks

October 2, 2012 at 10:33 am #77916

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Thank you Vinicio.

I have a feeling that the function:

homePageFullWidthSlider();

uses a loop. Could you paste the function in pastebin for me?

If I'm right, then this is what throws the page loop off which comes below the slider.

while (have_posts()) : the_post(); ?>

We may have to replace it with something like

$my_query = new WP_Query('$args');

- Referense info: http://codex.wordpress.org/Function_Reference/query_posts#Secondary_Loops

Let's not be too quick with editing code though. Can you please first send me the homePageFullWidthSlider() function?

October 2, 2012 at 10:56 am #77925

Vinicio

homePageFullWidthSlider() function: http://pastebin.com/DB7nw92c

Thank you!

October 2, 2012 at 11:23 am #77933

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Vinicio,

Thank you for this. Can you please try the following. Add:

wp_reset_query();

At the end of each while loop in the homePageFullWidthSlider() function.

This will be on line 63 and on line 103 like this:

} wp_reset_query();

If that does not make any differense we will try something else.

Again, be sure to back-up the original file before you modify it.

October 2, 2012 at 12:32 pm #77947

Vinicio

It works!

Thank you!!!

The topic ‘[Closed] Error: Duplicated posts in frontend’ is closed to new replies.