Title: function get_crp_posts_id
Last modified: August 24, 2016

---

# function get_crp_posts_id

 *  Resolved [mukiri](https://wordpress.org/support/users/mukiri/)
 * (@mukiri)
 * [11 years ago](https://wordpress.org/support/topic/function-get_crp_posts_id/)
 * Hi,
 * I am really loving this plugin, coz of the flexibility it gives me with function
   get_crp_posts_id().
 * However, can I ask for more?
 * Is it possible to specify more variables other than $postid, $limit? Say maybe
   specify a category, tag, etc (or exclude a post if it has these tags or categories?
   whether or not is has a post thumbnail, page or post etc.)
 * I am able to do this with the results of the function, but it would be nice if
   get_crp_posts_id() could sort this before returning a result..
 * Cheers
 * [https://wordpress.org/plugins/contextual-related-posts/](https://wordpress.org/plugins/contextual-related-posts/)

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

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years ago](https://wordpress.org/support/topic/function-get_crp_posts_id/#post-6171656)
 * Yes. You can pass all the options that CRP supports:
 * This is the source code:
    [https://github.com/ajaydsouza/contextual-related-posts/blob/master/contextual-related-posts.php#L353](https://github.com/ajaydsouza/contextual-related-posts/blob/master/contextual-related-posts.php#L353)
 * And the various options:
    [https://github.com/ajaydsouza/contextual-related-posts/blob/master/contextual-related-posts.php#L895](https://github.com/ajaydsouza/contextual-related-posts/blob/master/contextual-related-posts.php#L895)
 *  Thread Starter [mukiri](https://wordpress.org/support/users/mukiri/)
 * (@mukiri)
 * [11 years ago](https://wordpress.org/support/topic/function-get_crp_posts_id/#post-6171701)
 * OK, thanks, I almost get it.
 * But help me out with the code.. how do I pass new values to $crp_settings? apply_filters
   maybe to the crp_default_options function?
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years ago](https://wordpress.org/support/topic/function-get_crp_posts_id/#post-6171728)
 * If you want to use get_crp_posts_id, then you can pass any of the options of 
   the crp_default_options array as a parameter to get_crp_posts_id.
 * e.g.
 *     ```
       $args =  array(
       		'postid' => $post->ID,
       		'strict_limit' => TRUE,
       		'match_content' => false,
       );
       $results = get_crp_posts_id( $args );
       ```
   

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

The topic ‘function get_crp_posts_id’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/function-get_crp_posts_id/#post-6171728)
 * Status: resolved