• Need your help with this fatal error message that comes from the front-page.php:

    Call to undefined function types_render_field

    There are numerous other functions types_render on this page, but only this line is a problem:

    $featured_bg_img = types_render_field("featured-item-background-image", array("raw" => "true"));

    Can you please advise on how to fix this?

    Thanks much in advance.

    https://www.ads-software.com/plugins/types/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Dear chezsheles

    Where you call this function? Why is a different then other?

    And remember, this is for render, this function do not return anything.

    Marcin

    Thread Starter chezsheles

    (@chezsheles)

    Hi Marcin,

    Thanks for the quicky reply. It’s called on the front-page.php like so….

    <div class="featured-items" <?php if($featured_bg_img) { ?>style="background-image: url(<?php echo $featured_bg_img; ?>)"<?php } ?>>

    Dear chezsheles

    $featured_bg_img will be empty, because types_render_field do not return anything.

    Maybe you should try:

    $featured_bg_img = get_post_meta( get_the_ID(), 'wpcf-featured-item-background-image', true);

    Marcin

    Thread Starter chezsheles

    (@chezsheles)

    Thank you, I wil try this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘php fatal error: Call to undefined function types_render_field’ is closed to new replies.