Using Advanced Custom Fields in WordPress

3d Animation

This is my very basic guide to using the Advanced Custom Fields plugin in WordPress. Advanced Custom Fields allows you to add extra parameters and images to pages and blog posts in WordPress. For example you can use it to add an extra text field in the backend that then displays that value on a blog post or product page if you’re using WooCommerce.

Adding a new text field to a blog post using ACF in WordPress

1. Create a new text field in the ACF Plugin
2. Add some code to your template to display the created field
3. For example the created field is – ‘item-title’
4. To display in a post or page use the code below


<?php the_field('item_title'); ?>

Adding a image to a blog post using ACF in WordPress

1. Create a new image field in the ACF Plugin
2. Add some code to your template to display the created field
3. For example the created field is – ‘feature_image’
4. To display in a post or page use the code below


 <?php if( get_field('feature_image') ): ?>
<img src="<?php the_field('feature_image'); ?>" /><?php endif; ?>