Title: renderFunction not working
Last modified: August 22, 2016

---

# renderFunction not working

 *  Resolved [Daniel Rodrigues](https://wordpress.org/support/users/danielffr/)
 * (@danielffr)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/renderfunction-not-working/)
 * Hi,
    i’m trying to customize the results shown in the autocomplete.
 * In my `functions.php` i have the following code:
 *     ```
       function swiftype_javascript_config() {
       ?>
       <script type="text/javascript">
       var customRenderFunction = function(document_type, item) {
           return '<p class="title">test' + item['title'] + 'test</p>';
       };
       var swiftypeConfig = {
           renderFunction: customRenderFunction
       };
       </script>
       <?php
       }
   
       add_action('wp_head', 'swiftype_javascript_config');
       ```
   
 * I wrote this code by reading this documents:
    [https://swiftype.com/documentation/tutorials/customizing_wordpress_search](https://swiftype.com/documentation/tutorials/customizing_wordpress_search)
   [https://github.com/swiftype/swiftype-autocomplete-jquery](https://github.com/swiftype/swiftype-autocomplete-jquery)
 * This doenst seem to work. What am i missing here?
    Thanks in advance!
 * [https://wordpress.org/plugins/swiftype-search/](https://wordpress.org/plugins/swiftype-search/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [qhoxie](https://wordpress.org/support/users/qhoxie/)
 * (@qhoxie)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/renderfunction-not-working/#post-5279845)
 * Hello,
 * Have you verified that the javascript is being included in your template? If 
   you have a link to a live site, that would help with troubleshooting.
 * Best,
    Quin

Viewing 1 replies (of 1 total)

The topic ‘renderFunction not working’ is closed to new replies.

 * ![](https://ps.w.org/swiftype-search/assets/icon-256x256.png?rev=985923)
 * [Swiftype Site Search Plugin for Wordpress](https://wordpress.org/plugins/swiftype-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/swiftype-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/swiftype-search/)
 * [Active Topics](https://wordpress.org/support/plugin/swiftype-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/swiftype-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/swiftype-search/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [qhoxie](https://wordpress.org/support/users/qhoxie/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/renderfunction-not-working/#post-5279845)
 * Status: resolved