Hi Dev,
Today, we will show you How to get custom field data in WordPress. This article will give you simple example of How to get custom field data in WordPress. Let’s discuss How to get custom field data in WordPress. In this article, we will implement a How to get custom field data in WordPress.
So let’s follow few step to create example of How to get custom field data in WordPress.
Get Single Value Of Custom Field
<?php echo get_post_meta($post->ID, 'welcome', true); ?>
Get Acf Custom Field Data
<?php $home_page = get_fields(); $welcome = $home_page['welcome']; $title = $home_page['title']; $parg = $home_page['parg']; $btn = $home_page['btn']; $image = $home_page['image']; $slide = $home_page['slide']; ?> <?php echo $welcome; ?> Slider image get code <?php foreach( $slide as $banner ) { $banner_img = $banner['img']['url']; ?> <?php if ($banner_img) { ?> <img src="<?php echo $banner_img; ?>" alt="Code Planers" > <?php } ?> <?php } ?>