• I’ve added a custom field to one of my posts (and verified that it really is there), but I can’t get it to display on my blog page. Everything I’ve tried to access the meta data, including calling the_meta(), gives me nothing. Any idea what the problem might be?

Viewing 14 replies - 1 through 14 (of 14 total)
  • the_meta() is inside the loop?

    Thread Starter uncommon

    (@uncommon)

    Yes it is:
    <?php the_meta(); ?>
    <?php the_content(); ?>
    <?php edit_post_link(); ?>

    The rest of the content appears fine.

    and every key has a value?

    Thread Starter uncommon

    (@uncommon)

    Yes, there’s one key and it has a value.

    in your CSS file do you have class ‘post-meta’ or ‘post-meta-key’? make sure the font color is not the same as the background color??

    Thread Starter uncommon

    (@uncommon)

    I kept the definitions from the default CSS file. But I’ve examined the generated HTML, and there’s nothing there.

    Make sure you refresh, clear cache, and cookies, and refresh

    Go to wp-admin/template-functions-post.php
    and search for the_meta() function
    and make sure it’s not an empty function (doubt it, but heh..)

    Thread Starter uncommon

    (@uncommon)

    You mean wp-includes, right? Because that’s where it is, and the function looks right.

    Ok, I have nothing else to say but…
    upload the original index file and call it from there and then…
    I don’t know??

    Weird… that actually worked.
    The thing is, I have two pages where I’m displaying posts. One is my regular blog page, in /blog/. The other, where I’m trying to use the custom fields, is an the root level (it only shows messages in a certain category).
    I tried moving the default page out to the root level, and it still worked, so it’s not the location of the page.

    Thread Starter uncommon

    (@uncommon)

    OK, I figured it out. It was because I was including wp-config.php instead of wp-blog-header.php; I did that because wp-blog-header seemed like it was set up to only work in the same directory as the rest of the WP stuff. But I guess that’s not really true.
    What it boiled down to was the variable post_meta_cache wasn’t getting set up.

    As I remember my various tweakings it always was necessary to include the wp-blog-header on other pages…

    Without wp-blog-header.php, will the entry post even show up??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘the_meta not working’ is closed to new replies.