Is there a better way of retrieving the name of an acf pagelink type from current post?

The page link field actually stores the post ID, which gets formatted internally by the get_field function on output. The 3rd argument for get_field lets you disable that output formatting so you just get the ID back, which you can then use to get title and permalink for that post: $post_id = get_field( ‘bookitall_roomstype’, false, … Read more

html element to separate php variable strings – ACF datepicker

thanks to @kero, i managed to do something like this : <?php $dayNumber = “l”; $weekDay = “j”; $month = “F”; $year = “Y”; $unixtimestamp = strtotime(get_field(‘date’)); ?> <?php echo ‘<span>’ . date_i18n($dayNumber, $unixtimestamp) . ‘</span>’; ?> <?php echo ‘<span>’ . date_i18n($weekDay, $unixtimestamp) . ‘</span>’; ?> <?php echo ‘<span>’ . date_i18n($month, $unixtimestamp) . ‘</span>’; ?> … Read more

ACF Add fields values to newly inserted post [closed]

You can do this instead of using update_field(): update_post_meta($post_id, ‘fieldname’, $value); update_post_meta($post_id, ‘_fieldname’, ‘field_’ . uniqid()); // `uniqid() is a native PHP function. This is also how ACF creates the field keys Also, depending where you are retrieving the value, you may also have to pass the post id. the_field(‘fieldname’, $post_id);

How to populate a parent page with its child subpages and associated templates

You should look at archives.php. What you trying to do is create a custom post type loop (“pages) in different sections of your template. You have to filter by category, taxonomy, or tags to set up your different groupings. http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/ https://stackoverflow.com/questions/30883218/custom-post-type-wordpress-query-by-category I think this is what I mean: List all posts in custom post type … Read more