The Types Fields API page here:
http://wp-types.com/documentation/functions/
suggests the following syntax:
Code: Select all
<?php echo(types_render_field("field-slug", array("arg1"=>"val1","arg2"=>"val2"))); ?>So i entered this into my "custom-functions.php" file:
Code: Select all
echo (types_render_field("productimage", array("alt"=>"product image","width"=>"300","height"=>"200","proportional"=>"true")));so I defined the function as such (& trying to follow best practices) I used this:Fatal error: Call to undefined function types_render_field() in /public_html/wp-content/themes/dynamik/custom-functions.php on line 10
Code: Select all
function typestest () {
return (types_render_field("productimage", array("alt"=>"product image", "width"=>"300","height"=>"200","proportional"=>"true")));
}
echo typestest ();I am guessing that this is more a PHP problem as I think that I am putting the code into the correct file within wordpress as it is throwing an error code.
My understanding was that it was not really the best form to be using 'echo' within a function which is why I used return, and then called for the function using echo.
I realize that I probably have several errors here, but any assistance would be greatly appreciated as I wrap my brain around using PHP.
Thanks again in advance.