Title: [Plugin: Efficient Related Posts] How to add if function exists to avoid theme error?
Last modified: August 19, 2016

---

# [Plugin: Efficient Related Posts] How to add if function exists to avoid theme error?

 *  [MTV](https://wordpress.org/support/users/mtv/)
 * (@mtv)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-efficient-related-posts-how-to-add-if-function-exists-to-avoid-theme-error/)
 * > <?php wp_related_posts(array(‘title’=>’Most Related Post’, ‘num_to_display’
   > =>5)) ; ?>
 * The page shows blank, I don’t know what i am doing wrong here
 * > <?php if (function_exists(‘wp_related_posts’)) { wp_related_posts(array(‘title’
   > =>’Most Related Post’, ‘num_to_display’=>5))(); } ?><?php endif; ?>
 * [http://wordpress.org/extend/plugins/efficient-related-posts/](http://wordpress.org/extend/plugins/efficient-related-posts/)

Viewing 1 replies (of 1 total)

 *  [Aaron D. Campbell](https://wordpress.org/support/users/aaroncampbell/)
 * (@aaroncampbell)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-efficient-related-posts-how-to-add-if-function-exists-to-avoid-theme-error/#post-1278347)
 * Please ask support questions in the new [Efficient Related Posts Support Forums](http://xavisys.com/support/forum/efficient-related-posts/)

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Efficient Related Posts] How to add if function exists to avoid
theme error?’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Aaron D. Campbell](https://wordpress.org/support/users/aaroncampbell/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-efficient-related-posts-how-to-add-if-function-exists-to-avoid-theme-error/#post-1278347)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
