Hi @webadmin_auc,
referring to your post:
I have exactly the same problem, here is the answer from the WPML team:
Hi there,
While deactivating cornerstone plugin this issue is not replicated, so seems like a compatibility issue with the plugin, so I have forward the details to our Themes & Plugins Compatibility Team and they will contact the author. Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him.
We are closing the ticket but we will keep it for our records. You will be notified the moment we have the author’s cooperation in this process.
Thanks
For me it works perfect, because I don´t use the cornerstone plugin. If you use this plugin I found a workaround but it is not a perfect solution but it works and fix the issue.
Here is my solution:
I found the code line that causes the problem.
This is the following core file: /wp-includes/widgets/class-wp-widget-recent-posts.php
Version 4.8.4 the code is (this works for me):
$r = new WP_Query( apply_filters( ‘widget_posts_args’, array(
‘posts_per_page’ => $number,
‘no_found_rows’ => true,
‘post_status’ => ‘publish’,
‘ignore_sticky_posts’ => true
) ) );
if ($r->have_posts()) :
?>
<?php echo $args['before_widget']; ?>
<?php if ( $title ) {
echo $args['before_title'] . $title . $args['after_title'];
} ?>
<ul>
<?php while ( $r->have_posts() ) : $r->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?></a>
<?php if ( $show_date ) : ?>
<span class="post-date"><?php echo get_the_date(); ?></span>
<?php endif; ?>
</li>
<?php endwhile; ?>
</ul>
<?php echo $args['after_widget']; ?>
<?php
// Reset the global $the_post as this query will have stomped on it
wp_reset_postdata();
endif;
}
Version 4.9.1 the code is:
$r = new WP_Query( apply_filters( ‘widget_posts_args’, array(
‘posts_per_page’ => $number,
‘no_found_rows’ => true,
‘post_status’ => ‘publish’,
‘ignore_sticky_posts’ => true,
), $instance ) );
if ( ! $r->have_posts() ) {
return;
}
?>
<?php echo $args['before_widget']; ?>
<?php
if ( $title ) {
echo $args['before_title'] . $title . $args['after_title'];
}
?>
<ul>
<?php foreach ( $r->posts as $recent_post ) : ?>
<?php
$post_title = get_the_title( $recent_post->ID );
$title = ( ! empty( $post_title ) ) ? $post_title : __( '(no title)' );
?>
<li>
<a href="<?php the_permalink( $recent_post->ID ); ?>"><?php echo $title ; ?></a>
<?php if ( $show_date ) : ?>
<span class="post-date"><?php echo get_the_date( '', $recent_post->ID ); ?></span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php
echo $args['after_widget'];
Hope this helps.