• Resolved Aen

    (@aen)


    What I use in the regular page.php which works fine.

    <?php $page_image = get_post_custom_values('page_image'); ?>
    <?php echo $page_image[0]; ?>

    But when used in a custom page template, the kind you specify with

    /*
    Template Name: HOME
    */

    The custom field does not show up. It is specified in the page that uses the custom page template.

Viewing 6 replies - 1 through 6 (of 6 total)
  • MichaelH

    (@michaelh)

    Please paste all the code from that ‘Home’ template file into a pastebin such as wordpress.pastebin.ca, and report the link back here. Maybe someone can spot your problem. Thanks.

    Thread Starter Aen

    (@aen)

    MichaelH

    (@michaelh)

    Try

    <?php $page_image = get_post_custom_values('page_image',$posts[0]->ID); ?>

    senscore

    (@senscore)

    I have the same problem. In single (default) page template this works

    <?php $page_image = get_post_custom_values(‘page_image’,$posts[0]->ID); ?>
    <?php echo $page_image[0]; ?>

    But it does not work in custom page templates. Can not understand why…

    Any solutions?

    MichaelH

    (@michaelh)

    Works fine for me using the WordPress Default theme with custom page template and the page.php that comes with WordPress. This right after get_header;

    <?php echo 'post id ' . $posts[0]->ID; ?>

    Thread Starter Aen

    (@aen)

    Works for me thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom fields not showing in page template’ is closed to new replies.