Search
 
SCRIPT & CODE EXAMPLE
 

PHP

acf get image id sub_field

<?php
$imageID = get_sub_field('your_field');
$image = wp_get_attachment_image_src( $imageID, 'full' );
$alt_text = get_post_meta($imageID, '_wp_attachment_image_alt', true);
?>
<img src="<?php echo $image[0]; ?>" alt="<?php echo $alt_text; ?>" />
Comment

PREVIOUS NEXT
Code Example
Php :: get_adjacent_post wordpress 
Php :: php dirpath multiple file extensions 
Php :: echo errors php 
Php :: symfony messenger route 
Php :: $_get and $_post in php 
Php :: php check if valid xml 
Php :: html pagination php 
Php :: laravel passport client 
Php :: php functions parameters 
Php :: orwhere in wherehas laravel 
Php :: how check the checkbox is check php 
Php :: how to upload large video file in php 
Php :: php header not working 
Php :: html in php 
Php :: How to display custom field in wordpress? 
Php :: php include once inside a function? 
Php :: mysql escape apostrophe 
Php :: php trim 
Php :: Laravel API Endpoint "401 Unauthorized" on Server But Works Fine On Localhost 
Php :: routes not defined 
Php :: xampp php 5.6 download 64 bit 
Php :: php flatten array 
Php :: construct php 
Php :: laravel custom validation rules 
Php :: Laravel - Send mail using mail class 
Php :: math functions and predefined constants php 
Php :: get_the_terms 
Php :: php check jwt token expired 
Php :: how to use wherehas in laravel 
Php :: install a package only composer dont update 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =