Answers for "get custom field php wordpress"

PHP
2

wp display custom fields

<?php
// assign variables for each custom field
$your_custom_field_name1 = get_post_meta(get_the_ID(), 'your_custom_field_name', true);
$your_custom_field_name2 = get_post_meta(get_the_ID(), 'your_custom_field_name', true);

// if is not empty, echo html
if (!empty($your_custom_field_name1)) {
    echo '<h3>Label: ' . $your_custom_field_name1 . '<h3>';
    }
if (!empty($your_custom_field_name2)) {
    echo '<p>ISBN: ' . $your_custom_field_name2 . '</p>';
}
?>
Posted by: Guest on October-27-2020
0

wp+get custom field phpto

<div class="about_photo">
		<?php
		$value =get_field('about_photo');
		 echo "<img src='".$value."' width='200px' height='200px'>";
		 ?>
</div>
Posted by: Guest on November-20-2020

Code answers related to "get custom field php wordpress"

Browse Popular Code Answers by Language