Advertisement
isaacadams

ACF Fields - Basic

Jan 5th, 2021
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Display a field
  2. <p><?php the_field('field_name'); ?></p>
  3.  
  4. Working with Images – URL
  5. <img src="<?php the_field('image_test'); ?>" alt="" />
  6.  
  7. Working with Images – ID
  8. <?php $image = wp_get_attachment_image_src(get_field('image_test'), 'full'); ?>
  9. <img src="<?php echo $image[0]; ?>" alt="<?php echo get_the_title(get_field('image_test')) ?>" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement