Forum Replies Created

Viewing 15 replies - 1 through 15 (of 26 total)
  • Been trying to figure this out as well.

    You can get the image to work if you store the image as URL and use the shortcode to return the url inside an image tag

    <img src="[field field_name option=true]">

    Problem with this is though that it doesn’t return the srcset at all. I’ve been trying to make this work but haven’t had any luck. Inside post loop using [field image=field_name] works perfectly and you get the completely img markup.

    If anyone has any ideas, would be greatly appreciated.

    • This reply was modified 3 years, 6 months ago by finnfin.
    Thread Starter finnfin

    (@finnfin)

    Thank you for that. I think OAuth definitely would be a welcome addition. Opens up a lot of new possibilities. Looking forward to see what you come up with!

    Thread Starter finnfin

    (@finnfin)

    Tried changing it to
    function save_as_wp_date( $value, $term_id, $field )
    and same for the load function, but after saving the field, the field always reloads as August 25 1971. Which I don’t even understand, January 1st 1970 would make more sense.
    Need to figure out how to pass the term_id properly I guess.

    Thread Starter finnfin

    (@finnfin)

    I thought since the function isn’t defining any post ID it would work for all date picker fields, regardless what post type or taxonomy it’s in. But does look like it’s not actually updating the value at all in this particular field.

    Thread Starter finnfin

    (@finnfin)

    Thanks! Unfortunately I don’t think snippet actually works for this field for some reason, because acf_field= doesn’t return anything. And [taxonomy taxonomy_name field=date_field date_format=U] doesn’t work either unfortunately ??

    Thread Starter finnfin

    (@finnfin)

    Thanks! That actually does seem to work, unless I’m just missing something. Not sure I understand why it works, but it does seem to. ??

    Btw, documentation mentions 5 as the limit for nested IF loops. Is that 5 counting the top level, as in total 5 IFs?
    Edit. nevermind, got my answer. It’s 5 IFs total. In other words -----IF does not work.

    • This reply was modified 3 years, 10 months ago by finnfin.
    Thread Starter finnfin

    (@finnfin)

    Thanks! I had tried that too but was stupidly missing the [/pass]. Thanks for the help again!

    Thread Starter finnfin

    (@finnfin)

    Thanks!
    Yeah I actually tried that because I ran into the issue before. But it doesn’t help in this case. It does help in some cases, but doesn’t seem to when inside inline css.

    Like I mentioned, it works when using a Beaver Builder posts module. There I don’t need to use the [related] loop because the module itself does the looping. So what you suggested would suggest it should work, but I’m not sure why it doesn’t.

    Thread Starter finnfin

    (@finnfin)

    Thanks, yeah works fine that way. Is there any way to replace characters in the return value, or prevent certain characters from being displayed?

    I’m creating calendar links and certain characters are problematic for the URLs. Like ‘%’ doesn’t play well with Google Calendar links and should be encoded as %25. Any way to achieve that with just this plugin?

    Thread Starter finnfin

    (@finnfin)

    Follow up question related to time and date and formatting them. I’m trying to do some basic calculations using time. Like end time - start time to get duration, but having trouble getting any sort of output when doing calc with time, let alone with time and date.

    Is there any sort of proper method of doing that other than splitting everything into smaller chunks like day, month, yeah, hour and minute with set? Gets even trickier if start and end are on different dates.

    Edit: Is there any way to format date and time into a timestamp?

    • This reply was modified 3 years, 10 months ago by finnfin.
    Thread Starter finnfin

    (@finnfin)

    Actually just realized the [set] and [get] will do it as well. Thank you!

    Thread Starter finnfin

    (@finnfin)

    Of course! var to the rescue whenever there’s an issue. First one didn’t work, second did. Thanks!

    Thread Starter finnfin

    (@finnfin)

    Ah that’s very clever, thanks. I had to set value to 5 though to get 5 results, but everything seems to work as expected otherwise. Is it because count in this case starts from 0? Just want to understand what’s happening. ??

    Thread Starter finnfin

    (@finnfin)

    Is that limitation of the plugin or is that just ACF in general, do you know?

    I’m sorry I forgot to mention I’m passing another field to use as filtering method. And that is what is causing the issue with count

    [related event]
    [if var=my_list]
    [set my_list][get my_list],[field id][/set]
    [else]
    [set my_list][field id][/set]
    [/if]
    [/related]
    [pass vars]
    [loop type=my_content id={MY_LIST} count=5]
    [-pass field=event_type]
    [if pass='{-FIELD}' value=55]
    
    [field title]
    
    [else][/if][/-pass][/loop]
    [/pass]

    Is there a way to limit the count after the IF statement so that total output count is say 5, and not 5 after the loop before IF?

    Thread Starter finnfin

    (@finnfin)

    A true wizard. Thank you!

    Related problem; as mentioned this field is inside a repeater. How would one go about sorting repeater output based on that same field?

    [repeater field_name]
    [pass field=taxonomy-field]
    [for each=taxonomy-name term='{FIELD}' current=false]
    [each name]
    [/for]
    [/pass]
    [/repeater]

    How would sorting that output work?

    Sorting a relationship loop worked fine the way you suggested in another thread

    [related event]
    [if var=my_list]
    [set my_list][get my_list],[field id][/set]
    [else]
    [set my_list][field id][/set]
    [/if]
    [/related]
    [pass vars]
    [loop type=my_content id={MY_LIST} orderby=name order=ASC]
    Do what you need
    [/loop]
    [/pass]

    But I encountered another issue when trying to limit the output count by count=5. If you put that limit in the loop (or in the relationship loop), it seems to limit the number of loops it does not the final output count. It becomes apparent when you filter the results like above.

Viewing 15 replies - 1 through 15 (of 26 total)