Viewing 9 replies - 1 through 9 (of 9 total)
  • You already can: just use editable_post_meta() ??

    Thread Starter Pete

    (@perthmetro)

    I’m using this…

    <?php if( get_post_meta($post->ID, "slogan", true) ): ?>
    <?php echo get_post_meta($post->ID, "slogan", true); ?>
    <?php else: ?>
    <?php endif; ?>

    How would a php noob like myself do the php thang to make it work?

    Thread Starter Pete

    (@perthmetro)

    This nearly works… it gets highlighted, but just doesn’t become editable??

    <?php if( editable_post_meta($post->ID, "slogan", true) ): ?>
    <?php echo editable_post_meta($post->ID, "slogan", true); ?>
    <?php else: ?>
    <?php endif; ?>

    Just write:

    <?php editable_post_meta($post->ID, "slogan", true); ?>

    Thread Starter Pete

    (@perthmetro)

    Hmmm same as before?/

    <?php if( editable_post_meta($post->ID, "slogan", true) ): ?>
    <?php editable_post_meta($post->ID, "slogan", true); ?>
    <?php else: ?>
    <?php endif; ?>

    Why do you keep posting the same block of code, when I told you to replace it with a single line?

    Thread Starter Pete

    (@perthmetro)

    Becasue i want to make it conditional… anyway the single line as you say still doesn’t work.. same as before.

    It didn’t work because you didn’t bother to look at the arguments for editable_post_meta().

    Here is how the code should look:

    <?php if ( $slogan = get_editable_post_meta($post->ID, 'slogan', 'input', true) ): ?>
    <?php echo $slogan ?>
    <?php else: ?>
    <?php endif; ?>
    Thread Starter Pete

    (@perthmetro)

    Thanks so much for that… i’ll give it a whirl

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Front-end Editor] Can we edit page custom fields please :)’ is closed to new replies.