[Resolved] WordPressSEO and WPML CMS Conflict

Home Support English Support [Resolved] WordPressSEO and WPML CMS Conflict

This topic contains 4 replies, has 2 voices, and was last updated by  Ian 1 year, 8 months ago. The support staff assigned to this topic is Harshad.

Author Posts
Author Posts
December 10, 2012 at 10:35 pm #89567

Ian

Hi
I am seeing duplicate identical posts showing using the Canvas Theme from WooThemes with both WordPress SEO and WMPL CMS plugins activated.

If WordPress SEO is disabled and WPML CMS Ennabled then the blog post displays just one instance. If WPML CMS is disabled and WordPress SEO enabled then just one blog post instance. If both WPML CMS and WordPress SEO are enabled then two instances of the blog post show on one page.

http://mybeautycity.com/foundation/etude-moistfull-collagen-essence-in-base/

Since multiple themes are displaying this behaviour and the plugin combination creates the issue please advise a fix – one that preferably doesn't involve going into a theme and messing with the template files that are likely to be overwritten on any upgrade.

There is another thread on this issue that is marked as resolved by amending the theme template. However multiple people are experiencing the issue with varying themes but the same two plugins which seems to indicate a plugin incompatibility and not a theme issue.

Please assist.
Thanks

December 11, 2012 at 7:16 am #89597

Harshad
Forum moderator

Dear Ian,

Can you please paste the code of page template which displays the duplicated content?

December 11, 2012 at 7:49 am #89607

Ian

Hi
Ok in Woothemes Canvas there are two relevant templates – single.php which has the post loop and content-post.php which contains the instructions to GET the template.

Single.php:
<?php
/**
* Single Post Template
*
* This template is the default page template. It is used to display content when someone is viewing a
* singular view of a post ('post' post_type).
* @link http://codex.wordpress.org/Post_Types#Post
*
* @package WooFramework
* @subpackage Template
*/

get_header();
?>

<!– #content Starts –>
<?php woo_content_before(); ?>
<div id="content" class="col-full">

<div id="main-sidebar-container">

<!– #main Starts –>
<?php woo_main_before(); ?>
<div id="main">
<?php
woo_loop_before();

if (have_posts()) { $count = 0;
while (have_posts()) { the_post(); $count++;

woo_get_template_part( 'content', get_post_type() ); // Get the post content template file, contextually.
}
}

woo_loop_after();
?>
</div><!– /#main –>
<?php woo_main_after(); ?>

<?php get_sidebar(); ?>

</div><!– /#main-sidebar-container –>

<?php get_sidebar('alt'); ?>

</div><!– /#content –>
<?php woo_content_after(); ?>

<?php get_footer(); ?>

———————————————————————————-END

Then content-post.php

<?php
/**
* Post Content Template
*
* This template is the default page content template. It is used to display the content of the
* `single.php` template file, contextually, as well as in archive lists or search results.
*
* @package WooFramework
* @subpackage Template
*/

/**
* Settings for this template file.
*
* This is where the specify the HTML tags for the title.
* These options can be filtered via a child theme.
*
* @link http://codex.wordpress.org/Plugin_API#Filters
*/
global $woo_options;

$title_before = '<h1 class="title">';
$title_after = '</h1>';

if ( ! is_single() ) {

$title_before = '<h2 class="title">';
$title_after = '</h2>';

$title_before = $title_before . '<a href="' . get_permalink( get_the_ID() ) . '" rel="bookmark" title="' . the_title_attribute( array( 'echo' => 0 ) ) . '">';
$title_after = '</a>' . $title_after;

}

$page_link_args = apply_filters( 'woothemes_pagelinks_args', array( 'before' => '<div class="page-link">' . __( 'Pages:', 'woothemes' ), 'after' => '</div>' ) );

woo_post_before();
?>
<div <?php post_class(); ?>>
<?php
woo_post_inside_before();
if ( $woo_options['woo_post_content'] != 'content' AND !is_singular() )
woo_image( 'width='.$woo_options['woo_thumb_w'].'&height='.$woo_options['woo_thumb_h'].'&class=thumbnail '.$woo_options['woo_thumb_align'] );
the_title( $title_before, $title_after );
woo_post_meta();
?>
<div class="entry">
<?php
if ( $woo_options['woo_post_content'] == 'content' || is_single() ) { the_content(__('Continue Reading →', 'woothemes') ); } else { the_excerpt(); }
if ( $woo_options['woo_post_content'] == 'content' || is_singular() ) wp_link_pages( $page_link_args );
?>
</div><!– /.entry –>
<div class="fix"></div>
<?php
woo_post_inside_after();
?>
</div><!– /.post –>
<?php
woo_post_after();
$comm = $woo_options[ 'woo_comments' ];
if ( ( $comm == 'post' || $comm == 'both' ) && is_single() ) { comments_template(); }
?>

———————————————————————————END

Problem persists.
Thanks for the assistance
Ian

December 11, 2012 at 8:01 am #89608

Harshad
Forum moderator

Dear Ian,

Okay, Can you please replace the below code

if (have_posts()) { $count = 0;
while (have_posts()) { the_post(); $count++;

woo_get_template_part( 'content', get_post_type() ); // Get the post content template file, contextually.
}
}

with

if (have_posts()) { $count = 0;
the_post(); $count++;

woo_get_template_part( 'content', get_post_type() ); // Get the post content template file, contextually.
}
December 11, 2012 at 10:01 am #89655

Ian

That solved the problem.
However I do not understand why the issue arises only when the two plugins are enabled – it seems many themes have the same issue – is there a short explanation.

Support fantastic as all resolved in one day which is so unusual.
Thanks.

You must be logged in to reply to this topic.