WordPress.org

Ready to get started?Download WordPress

Forums

Custom field problem (3 posts)

  1. michaelphill
    Member
    Posted 3 years ago #

    I'm trying to create a page that lists the name and link to each of its child pages along with a custom thumbnail image for each.

    I created a custom field in each of the child pages called "Thumbmail" and have a URL entered in there.

    I think use this code:
    http://pastebin.com/r39edWmn

    The names of the child pages output fine and the links work, but the images do not. If you look at the source code, this is what is outputted: <img src="" width="80" height="80">.

    Any ideas why?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    http://codex.wordpress.org/Custom_Fields
    http://codex.wordpress.org/Function_Reference/get_post_meta

    try:

    <a href="<?php echo get_page_link($page->ID) ?>"><img src="<?php echoget_post_meta($page->ID, "Thumbnail", true); ?>" width="70" height="70"></a><a href="<?php echo get_page_link($page->ID) ?>"><h3><?php echo $page->post_title ?></h3></a></div>
  3. michaelphill
    Member
    Posted 3 years ago #

    That completely broken the page; now nothing outputs :-(

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.