• No matter what I do, I cannot get my custom fields to display. I am using WP 3.0 with this code:

    <img src="<?php echo get_post_meta(get_the_ID(), "splashpageimage1", true); echo $splashpageimage1; ?>" alt="" />

    This seemed to work fine in the past… and now it’s not displaying anything.

    nor is this:

    img src="<?php $splashpageimage1 = get_post_meta($post->ID, "splashpageimage1", true); echo $splashpageimage1; ?>" />

Viewing 4 replies - 1 through 4 (of 4 total)
  • mmmm hard to tell.

    Try it on a different theme, if that doesn’t work try uninstalling your plugins. to see it is a plugin issue.

    try using this to see if you get any output print_r( get_post_meta($post->ID, "splashpageimage1"))

    Check that you do have a value for $post->ID doing echo $post->ID if that does’t work make your that your spelling is exact on “plashpageimage1” upper, lower case, spaces, dash etc.

    Thread Starter Michael D

    (@michael-divine)

    Thanks for the response…

    Try it on a different theme, if that doesn’t work try uninstalling your plugins. to see it is a plugin issue.

    >>> deactivated all plugins, no issue there.

    try using this to see if you get any output print_r( get_post_meta($post->ID, “splashpageimage1”))

    >>> Resulted in the printing of “Array”

    Check that you do have a value for $post->ID doing echo $post->ID if that does’t work make your that your spelling is exact on “plashpageimage1” upper, lower case, spaces, dash etc.
    >>> echo…. resulted in the post ID being printed.
    >>> all of the spelling is correct…

    continuing to bang head against wall…

    any other thoughts? what is the exact code that you would use?

    mmmm this is bad. not sure what could be causing your problem have you try using any of the other custom field functions

    get_post_custom
    get_post_custom_keys
    get_post_custom_values
    get_post_meta

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

    Thread Starter Michael D

    (@michael-divine)

    I haven’t tried any of those. To be honest – I’m not a php guru so much as a php-copy-paste-hacker. So i don’t know where exactly to dig deeper. Also, the theme is something that I created for a client. It’s not terribly robust or anything, nor does it have a great big functions.php file that might interfere somehow.

    So, yes, troubling. And doesn’t make me want to update my own site with WP3.0…

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom Fields not working in 3.0’ is closed to new replies.