Support » Themes and Templates » What is wrong with this code snippet??

  • Resolved ThorHammer

    (@thorhammer)


    I use this code in order to get custom field values (image urls):

    <?php
    } ?>
    <?php $withdraws=get_post_meta($post->ID,"tcwithdraws",false); ?>
    
    <?php foreach($tcwithdraws as $withdraw)
    {
    list($width, $height, $type, $attr) = getimagesize($withdraw);
    ?>
    <img src="<?php echo $withdraw;?>" <?php echo $attr; ?> alt="">
    <? } ?>

    The custom key I have created is named “tcwithdraws“. The value is image urls. But I get told that I have an un-defined variable?? Could anyone please point it out from this code??

Viewing 1 replies (of 1 total)
  • ThorHammer

    (@thorhammer)

    Never mind, I found the error. The first variable missed the “tc” in the start.

Viewing 1 replies (of 1 total)
  • The topic ‘What is wrong with this code snippet??’ is closed to new replies.