Get posts meta_query by repater field
Get posts meta_query by repater field
Get posts meta_query by repater field
Ok I figured it out! The setup is a little different but it works great. PHP / HTML Working Code <section class=”dev-slider-wrppr”> <div class=”dev-slider-row”> <div class=”slider-for”> <?php if( have_rows(‘slider_content’) ): ?> <?php while( have_rows(‘slider_content’) ): the_row(); ?> <?php $slideimage = get_sub_field(‘slider_image’); $slidetitle = get_sub_field(‘slider_title’); $slidebdycpy = get_sub_field(‘slider_body_copy’); ?> <div class=”slick-container”> <h4 class=”info-title text-center”><?php echo $slidetitle; … Read more
Finally found this solution on the ACF support forums. All I had to do was add this to my functions.php file in my custom theme: //Include CPT In Categories Pages function namespace_add_custom_types( $query ) { if( is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) { $post_types = get_post_types( ”, ‘names’ ); $query->set( ‘post_type’, $post_types); return … Read more
I found some code that allows both Post Title and Slug to be generated from custom field data: function recipe_update_title( $value, $post_id, $field ) { $new_title = get_field( ‘recipe_name’, $post_id) . ‘ ‘ . $value; $new_slug = sanitize_title( $new_title ); // update post $recipe_postdata = array( ‘ID’ => $post_id, ‘post_title’ => $new_title, ‘post_name’ => $new_slug, … Read more
I have not used ACF before but i suspect your post-2.php lacks $post_id as in have_rows($field_name, $post_id)(see). If you are using ajax there is no way that your ajax function know the page you are on and what post you are seeking so you better use $post_id to tell ajax function which post data you … Read more
Add column and acf field content for cpt
Display related post content and custom field content
Add a mailto button next to custom field download link
Try this code: <div class=”map”> <?php global $post; $location = get_field(‘location’, $post->ID); ?> <div class=”acf-map”> <div class=”marker” data-lat=”<?php echo $location[‘lat’]; ?>” data-lng=”<?php echo $location[‘lng’]; ?>”></div> </div> </div> Sometimes in the template you’re loading this you don’t have the post that the field belongs to, so you can try to fetch it in the global $post … Read more
Values show up in custom home page but not in custom post pages