WordPress.org

Ready to get started?Download WordPress

Forums

Now Reading Reloaded
[resolved] Accessing custom fields (3 posts)

  1. Jeff
    Member
    Posted 3 years ago #

    I'm trying to use custom metadata in my library entries, without any luck. I have a custom key 'book_desc' for example, with some copy in the value box.

    Using the obvious(?)
    $desc = get_post_meta($post->ID,'book_desc',true); echo $desc;
    in my template doesn't produce any output. Tried replacing "post" with "book" in the above, just for kicks, with no result, either.

    Using the_meta() gives me metadata from a post on my blog, but nothing to do with the books I'm working with.

    Has anyone had success with custom metadata? Thanks!

  2. impleri
    Member
    Posted 3 years ago #

    You can't use the standard WP meta function because NRR uses its own tables. I've been working on changing this (and updating NRR to work nicely with WP 3.1) and have mode quite a bit of headway in the Amazon Media Libraries plugin. You'll want to use get_book_meta(), update_book_meta(), and delete_book_meta() at least until AML gets production ready.

  3. Jeff
    Member
    Posted 3 years ago #

    Ah, yes -- thanks! And I just found print_book_meta() in the 'single' template -- should have looked there first!

    Appreciate the help, and glad to hear the plugin's still being worked on!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic