Title: Template function throws up an error
Last modified: August 10, 2019

---

# Template function throws up an error

 *  Resolved [ecohostingservices](https://wordpress.org/support/users/ecohostingservices/)
 * (@ecohostingservices)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/template-function-throws-up-an-error/)
 * Hi
    Great plugin and working ok but I had an issue when the featured imaged appeared
   twice and that was because of the template file. I removed the featured image
   code in the template file.
 * I then added the following code as suggested in your FAQ:
 *     ```
       if ( function_exists('cc_zoom_featured_image') ) {
                       cc_zoom_featured_image(); //This throws up the error below
                       //echo do_shortcode( '[zoom zoomin=2]' ); this works
       }
       ```
   
 * But it throws up this error:
 * Fatal error: Uncaught ArgumentCountError: Too few arguments to function cc_zoom_featured_image(),
   0 passed in C:\Users\Colin\Documents\My Web Sites\Divi\wp-content\themes\mesmerizechildtheme\
   template-parts\content-info.php on line 18 and at least 1 expected in C:\Users\
   Colin\Documents\My Web Sites\Divi\wp-content\plugins\featured-image-zoom\featured-
   image-zoom.php:84 Stack trace: #0 C:\Users\Colin\Documents\My Web Sites\Divi\
   wp-content\themes\mesmerizechildtheme\template-parts\content-info.php(18): cc_zoom_featured_image()#
   1 C:\Users\Colin\Documents\My Web Sites\Divi\wp-includes\template.php(724): require(‘
   C:\\Users\\Colin\\…’) #2 C:\Users\Colin\Documents\My Web Sites\Divi\wp-includes\
   template.php(671): load_template(‘C:\\Users\\Colin\\…’, false) #3 C:\Users\Colin\
   Documents\My Web Sites\Divi\wp-includes\general-template.php(168): locate_template(
   Array, true, false) #4 C:\Users\Colin\Documents\My Web Sites\Divi\wp-content\
   themes\mesmerizechildtheme\single-grave.php(18): get_template_part(‘template-
   parts/…’, ‘info’) in C:\Users\Colin\Documents\My Web Sites\Divi\wp-content\plugins\
   featured-image-zoom\featured-image-zoom.php on line 84
 * So what arguments do I have to put in to get the code to work?
 * Thanks
 * Colin

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

 *  Plugin Author [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/template-function-throws-up-an-error/#post-11820580)
 * You can pass an empty value to use the default parameter values:
 * `echo cc_zoom_featured_image('');`
 * or an array containing the parameter/value pair(s) you want to change from the
   defaults:
 * `echo cc_zoom_featured_image( array( 'zoomin' => '2') );`
 * I will update the plugin’s faq to clarify this.
    -  This reply was modified 6 years, 9 months ago by [cubecolour](https://wordpress.org/support/users/numeeja/).
 *  Thread Starter [ecohostingservices](https://wordpress.org/support/users/ecohostingservices/)
 * (@ecohostingservices)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/template-function-throws-up-an-error/#post-11820833)
 * Thanks for clarifying that, just tried it and it worked. So now 2 ways of using
   it in the template file.
 * Your plugin is great on maps and grave headstones, a project I am working on 
   at the moment.
 * Cheers
 * Colin
 *  Plugin Author [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/template-function-throws-up-an-error/#post-11820997)
 * Great! I’m glad it is working for you.

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

The topic ‘Template function throws up an error’ is closed to new replies.

 * ![](https://ps.w.org/featured-image-zoom/assets/icon-256x256.jpg?rev=1599203)
 * [Featured Image Zoom](https://wordpress.org/plugins/featured-image-zoom/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/featured-image-zoom/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/featured-image-zoom/)
 * [Active Topics](https://wordpress.org/support/plugin/featured-image-zoom/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/featured-image-zoom/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/featured-image-zoom/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [cubecolour](https://wordpress.org/support/users/numeeja/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/template-function-throws-up-an-error/#post-11820997)
 * Status: resolved