• Resolved ecohostingservices

    (@ecohostingservices)


    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

    (@numeeja)

    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 5 years, 7 months ago by cubecolour.
    Thread Starter ecohostingservices

    (@ecohostingservices)

    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

    (@numeeja)

    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.