WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
[resolved] Detailed instructions for using with custom fields? (5 posts)

  1. scottsemple
    Member
    Posted 3 years ago #

    I've read the posts talking about editable-post-meta for editing custom fields, but I don't completely understand how to set it up. Is the following correct?

    # Add editable_post_meta to functions.php. (If so, what is the code to add the function?):
    # Then how is it called in the template?

    For example, I have several custom fields set up with something like:
    <strong>Season:</strong> <?php echo $custom_fields['season'][0]; ?>

    So how do I add the editable_post_meta to this?

    Thanks!

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    $custom_fields didn't come from thin air. Look above it for a call to get_post_custom().

    In any case, it's equivalent to get_post_meta( $post->ID, 'season', true );

    Also, see this page: https://github.com/scribu/wp-front-end-editor/wiki/Editing-custom-fields

  3. scottsemple
    Member
    Posted 3 years ago #

    Damn, I thought for sure it came from thin air.

    Thanks!

  4. scottsemple
    Member
    Posted 3 years ago #

    So to test, I tried these two alongside each other:

    <strong>Season:</strong> <?php echo $custom_fields['season'][0]; ?>
    <strong>Season:</strong> <?php get_post_meta( $post->ID, 'season', true ); ?>

    But nothing appears for the second instance of Season.

    What am I doing wrong? (Sample: http://climbfolio.com/climbs/the-maul/)

  5. scottsemple
    Member
    Posted 3 years ago #

    Disregard. Forgot the echo. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic