Title: Widget keeps showing the same posts
Last modified: August 21, 2016

---

# Widget keeps showing the same posts

 *  Resolved [yiannis_](https://wordpress.org/support/users/yiannis_/)
 * (@yiannis_)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/)
 * Hi and thanks for a really cool plugin.
    I am using the short-code version on
   my website successfully, however the widget seems to be stuck showing the same
   posts.
 * Any idea why this may be happening?
 * Y
 * [https://wordpress.org/plugins/contextual-related-posts/](https://wordpress.org/plugins/contextual-related-posts/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729479)
 * Is it the same posts for all posts on your site?
 * Will need the URL to check.
 *  Thread Starter [yiannis_](https://wordpress.org/support/users/yiannis_/)
 * (@yiannis_)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729484)
 * Thanks for the reply.
 * The issue was that $post->ID was always returning the same ID in the following
   section. I managed to fix this by adding:
 * > // Retrieve the list of posts
   >  if (!$is_widget) { $results = get_crp_posts_id(
   > array_merge( $args, array( ‘postid’ => $post->ID, ‘strict_limit’ => TRUE, )));
   >  }
   >  if ($is_widget) {
   >  $page_object = get_queried_object(); $page_id = get_queried_object_id();
   > $results = get_crp_posts_id( array_merge( $args, array( ‘postid’ => $page_id,‘
   > strict_limit’ => TRUE, ) ) );
   >  }
 * A url from the site [here](http://cosmopoliti.com/tribute-to-a-supreme-fashion-fantasist-the-unique-life-and-times-of-isabella-blow/)
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729546)
 * Can you tell me which lines of the code did you change?
 * I just checked out your site, but unfortunately, I can’t find the exact position
   of the related posts due to the language difference.
 *  Thread Starter [yiannis_](https://wordpress.org/support/users/yiannis_/)
 * (@yiannis_)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729569)
 * This is in line 70 in contextual-related-posts.php.
    The widget is on the RHS
   column of the website [http://prntscr.com/3328jp](http://prntscr.com/3328jp) 
   Y.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729571)
 * Understood. The idea of $post is to fetch the global post ID and then find related
   posts for it.
 * Is there something that is interfering with this that is forcing you to set the`
   get_queried_object_id`?
 *  Thread Starter [yiannis_](https://wordpress.org/support/users/yiannis_/)
 * (@yiannis_)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729589)
 * Not that I can think of. Having said that, I had an issue with get_queried_object_id
   on another website on this server.
 * Could this be a server setting that was to do with the way it is registering 
   globals?
 * Y.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729596)
 * It might be the case, but it definitely is well above my PHP and server knowledge.
 * Do you know if the plugin works well when you’re using the inline post option
   and not the widget?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Widget keeps showing the same posts’ is closed to new replies.

 * ![](https://ps.w.org/contextual-related-posts/assets/icon-256x256.png?rev=2985705)
 * [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contextual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contextual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/contextual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contextual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contextual-related-posts/reviews/)

## Tags

 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 7 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/widget-keeps-showing-the-same-posts/#post-4729596)
 * Status: resolved