WordPress implode & wp_insert_post question

The second parameter to wp_set_object_terms() takes an array, integer, or string. (array/int/string) (required) The slug or id of the term (such as category or tag IDs), will replace all existing related terms in this taxonomy. To clear or remove all terms from an object, pass an empty string or NULL. Integers are interpreted as tag … Read more

Why is my WP Query not returning first result’s post meta?

$show_date = get_field(‘show_date’); $show_venue = get_field(‘show_venue’); // print ‘<pre>’; // print_r($show_date); // print ‘</pre>’; $query->the_post(); You are setting the active post AFTER getting the values. Put $query->the_post() always at the top of that while loop, so that the other functions can rely on the global $post variable being set correctly.

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)