New answers tagged

0 votes

Generate the post title from ACF fields

The $post_id value get in save_post hook might be revision ID. So to retrieve real post ID, you can use this function wp_is_post_revision() Try to change your code as follows, function ...
user avatar
  • 21
0 votes

get the title of a relationship field

you don't need a function... $my_query = get_posts(array( 'post_type' => 'post_type_name', 'meta_query' => array( array( 'key' => 'relationship_field_name', ...
user avatar
  • 1
0 votes

ACF get_sub_field ALT TAG in the repeater doesn't show

I have an alternative solution. Instead of using the image array in your ACF field, use the image id. Then use: <?php $image_id = get_sub_field('image'); ?> <?php echo ...
user avatar
  • 621
0 votes
Accepted

ACF get_sub_field ALT TAG in the repeater doesn't show

See here for ACF image docs. https://www.advancedcustomfields.com/resources/image/ If image field is set to return as an array then you need store the image subfield into a variable and use the ...
user avatar
  • 447
0 votes

Search using ACF repeater

You can filter ACF repeater field sub fields on the front end using some jQuery. See basic example below. See live working demo here: https://jsfiddle.net/joshmoto/ns73z05b/ See comments in jQuery so ...
user avatar
  • 447

Top 50 recent answers are included