Hot answers tagged

6

Tell your boss that Visual Composer is the cancer of WordPress. Tell your boss that you've separated content concerns from visual ones, and that you're not tied into an abhorrent shortcode nightmare should you ever wish to move away from VC and/or change the layout. To elaborate, "VC vs ACF" isn't really a question - they are two completely different ...


1

I copied your code to one of my sites to test with ACF version 5.3.9.2. And it works for me I just had to make sure the field name and image size were correct. $size = get_field('slideshow_size') ?: 'Panoramic'; // Make sure this size exists, and usually is all lower case. $column_id[ $i ] = $row['slideshow-image']['id']; // Field names in ACF normally ...


1

You need to make the whole line conditional, like this: $sub_field_title = get_sub_field('title'); if (!empty($sub_field_title)) { echo '<h1 class="title">' . $sub_field_title . '</h1>'; }


1

Arrays are serialized by default, so just do update_post_meta($my_post, 'ganalytics_settings', $ganalytics_settings); https://codex.wordpress.org/Function_Reference/update_post_meta $meta_value (mixed) (required) The new value of the custom field. A passed array will be serialized into a string.(this should be raw as opposed to sanitized for ...


1

Remove return; from your code, which is prematurely exiting the function before the following two lines can be executed; that is why the status is not changed. function my_change_status_function () { global $post; $ordernumber = get_post_meta( $post->ID, 'order_number', true ); $audit_status = get_post_meta( $post->ID, 'audit_status', ...



Only top voted, non community-wiki answers of a minimum length are eligible