Answers for "acf fetch fields from a custom function"

PHP
1

get custom field

/* put this code in home.php file create in child theme  */

<?php 
 /*Template Name: Home Template*/
 
echo get_post_meta($post->ID, 'Name', true); 
  
?>
 /* Or use this code  */
 <?php 
	$value =get_field('Name');
	echo $value;
?>
Posted by: Guest on October-23-2020
1

get field acf

$content = get_field('content', $post_id);
Posted by: Guest on October-13-2020

Browse Popular Code Answers by Language