update_field() with repeater fields issue [closed]
Solved!!! $post_id = $pid; needs to be $post_id = “user_{$pid}”; Seems pretty obvious now as the id could be for anything. Chris
Solved!!! $post_id = $pid; needs to be $post_id = “user_{$pid}”; Seems pretty obvious now as the id could be for anything. Chris
if I recall correctly, get_field() simply returns the value of the field, not the actual term object. try using this with get_term() (or get_term_by() depending on your needs/preference).
if(get_sub_field(‘catalog_product_title’)); ; is for ending a statement in php If you remove that ; your if statement should work.
The functions.php file doesn’t know where you want that code to be shown on the front end. You need to put the code into a template page (ie the woocommerce account page) or attach it to that page with a woocommerce hook to the template. You’ll need to add it into a function to properly … Read more
I don’t think ACF is the plugin that you need for this kind of goal. ACF provides an ability to add custom fields in the admin panel and shows the data supplied in the frontend. What you need is a plugin that will allow you to add custom fields for users to fill up in … Read more
$birthday_ts = strtotime( get_field(‘dob’) ); $now = current_time( ‘timestamp’ ); $years = intval( ( $now – $birthday_ts ) / YEAR_IN_SECONDS ); $months = intval( ( $now – $birthday_ts ) / MONTH_IN_SECONDS ); $weeks = intval( ( $now – $birthday_ts ) / WEEK_IN_SECONDS ); $days = intval( ( $now – $birthday_ts ) / DAY_IN_SECONDS ); $hours … Read more
What “return format” do you have set in ACF for the date field? Sorting by numbers produces unexpected results when you use “d/m/Y” or “m/d/Y”. If you instead choose “Ymd” as in “20180221” for the return format, you’ll get an integer that’s sortable in the expected way.
Nevermind, got it – it’s simply {{ group }} when calling the value! {% for contact in mc.contacts %} {% for group in contact.groups %} {{ group }} {% endfor %} {% endfor %}
The code seems to be good to me, may be try to correct this line : echo ‘<li>’ . implode( ‘, ‘, $names ) . ‘<li>’; To : echo ‘<li>’ . implode( ‘, ‘, $names ) . ‘</li>’; You forget to close the li tag. Same thing here : echo ‘<li>’ . implode( ‘, ‘, … Read more
I would create a custom query for each nested loop and loop on its post data. Similar to what is written about here. You will probably need to save the post global to a temporary variable so it can be set back ( setup_postdata() ) at the end of the nested look.