Home › Forums › General Issues › Live Edit labels empty after creating a post using acf_form › Reply To: Live Edit labels empty after creating a post using acf_form
And here is my single.php:
<?php get_header(); ?>
</header>
<div id="content" class="row artist single-col">
<?php the_post(); ?>
<article <?php if(function_exists("live_edit")){live_edit('post_title,short_blurb,photo, instrument_or_service, facebook_link, twitter_link, email_address, website_address, soundcloud_link, bandcamp_link, itunes_link, youtube_link, vimeo_link, audio_track_or_playlist, single_bandcamp_audio_tracks, youtube_videos, vimeo_videos, another_photo, full_bio'); }?>>
<?php
$attachment_id = get_field('photo');
$size = "medium"; // (thumbnail, medium, large, full or custom size)
$image = wp_get_attachment_image_src( $attachment_id, $size );
?>
<img class="artist alignleft" src="<?php echo $image[0]; ?>" />
<h1 class="h2"><?php the_title(); ?></h1>
<?php
$tags = get_field('instrument_or_service');
if( $tags ):
echo '<p>';
foreach( $tags as $tag):
setup_postdata($tag);
echo '<a href="/' . $tag->taxonomy . '/' . $tag->slug . '">' . $tag->name . '</a>, ';
endforeach;
endif; wp_reset_postdata();
?>
</p>
<p><?php the_field('short_blurb'); ?></p>
<div class="social-links">
<?php if( get_field('facebook_link') ) { ?>
<a title="Facebook" href="<?php the_field('facebook_link'); ?>" class="facebook-link">Facebook</a>
<?php } ?>
<?php if( get_field('twitter_link') ) { ?>
<a title="Twitter" href="<?php the_field('twitter_link'); ?>" class="twitter">Twitter</a>
<?php } ?>
<?php if( get_field('email_address') ) { ?>
<a title="Email" href="mailto:<?php the_field('email_address'); ?>" class="email">Email</a>
<?php } ?>
<?php if( get_field('website_address') ) { ?>
<a title="Website" href="<?php the_field('website_address'); ?>" class="website">Website</a>
<?php } ?>
<?php if( get_field('soundcloud_link') ) { ?>
<a title="Soundcloud" href="<?php the_field('soundcloud_link'); ?>" class="soundcloud">Soundcloud</a>
<?php } ?>
<?php if( get_field('bandcamp_link') ) { ?>
<a title="Bandcamp" href="<?php the_field('bandcamp_link'); ?>" class="bandcamp">Bandcamp</a>
<?php } ?>
<?php if( get_field('itunes_link') ) { ?>
<a title="iTunes" href="<?php the_field('itunes_link'); ?>" class="itunes">iTunes</a>
<?php } ?>
<?php if( get_field('youtube_link') ) { ?>
<a title="YouTube" href="<?php the_field('youtube_link'); ?>" class="youtube">YouTube</a>
<?php } ?>
<?php if( get_field('vimeo_link') ) { ?>
<a title="Vimeo" href="<?php the_field('vimeo_link'); ?>" class="vimeo">Vimeo</a>
<?php } ?>
</div>
<div class="controls">
<a href="#listen">Listen</a>
<a href="#watch">Watch</a>
<a href="#read">Read</a>
</div>
<section id="listen">
<h2>Listen</h2>
<div class="row">
<?php if( get_field('audio_track_or_playlist') ): ?>
<?php while( has_sub_field('audio_track_or_playlist') ): ?>
<?php the_sub_field('track_id_number_soundcloud'); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php if( get_field('single_bandcamp_audio_tracks') ): ?>
<?php while( has_sub_field('single_bandcamp_audio_tracks') ): ?>
<?php the_sub_field('track_id_number_bandcamp'); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<h2>Releases/Appears On</h2>
<section class="thumb-list">
<div>
<a class="thumb" href="<?php the_permalink(); ?>"><img src="http://placehold.it/150/150"></a>
<p>
<a href="">Release Name</a><br />
<em>Artist Name</em><br />
<span class="date">the date</span>
</p> </div>
<div>
<a class="thumb" href="<?php the_permalink(); ?>"><img src="http://placehold.it/150/150"></a>
<p>
<a href="">Release Name</a><br />
<em>Artist Name</em><br />
<span class="date">the date</span>
</p>
</div>
<div>
<a class="thumb" href="<?php the_permalink(); ?>"><img src="http://placehold.it/150/150"></a>
<p>
<a href="">Release Name</a><br />
<em>Artist Name</em><br />
<span class="date">the date</span>
</p>
</div>
</section>
</section>
<section id="watch">
<h2>Watch</h2>
<?php if( get_field('youtube_videos') ): ?>
<?php while( has_sub_field('youtube_videos') ): ?>
<div class="video">
<?php $code = get_sub_field('video_link'); ?>
<?php echo do_shortcode('[youtube id="'.$code.'"]'); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php if( get_field('vimeo_videos') ): ?>
<?php while( has_sub_field('vimeo_videos') ): ?>
<div class="video">
<?php $code = get_sub_field('video_link'); ?>
<?php echo do_shortcode('[vimeo id="'.$code.'"]'); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</section>
<section id="read">
<h2>Read</h2>
<?php
if( get_field('another_photo') ){
$attachment_id = get_field('another_photo');
$size = "medium"; // (thumbnail, medium, large, full or custom size)
$image = wp_get_attachment_image_src( $attachment_id, $size );
?>
<img class="artist alignleft" src="<?php echo $image[0]; ?>" />
<?php } ?>
<?php the_field('full_bio'); ?>
</section>
</article>
<?php get_footer(); ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.