2012-07-30, 05:54:35
tommy Wrote:how do i output a custom field called "myimage" for each of the subpages in the custom rendering?
i tried the code below but no image generated.
<li class="<?php echo $item->classes; ?>">
<a href="<?php echo htmlspecialchars($item->link); ?>">
<?php echo htmlspecialchars($item->text); ?>
</a>
<?php get_custom_field('$item->myimage'); ?>
</li>
Assuming that the custom field contains the full image URL:
Code:
<img src="<?php echo htmlspecialchars($item->myimage); ?>" title="My Image"/>